v0.4.0
Per-tenant resource accounting and hard quotas
From the changelog · release notes and binaries
Added
-
Per-tenant resource accounting and hard quotas. The engine now tracks, per tenant, the hot-key cache bytes and the live on-disk KV bytes each tenant holds, and can enforce optional hard limits at admission.
VLoggains atenant(id)view that scopes cache residency and disk accounting to a tenant; the per-tenant disk total is rebuilt from the index on restart. ATenantBackend::limits(tenant)hook lets a deployment cap a tenant’s vector count (max_vectors, checked onSKEG.VSET) and its on-disk KV bytes (max_disk_bytes, checked onSET); an over-limit write is rejected before anything is stored. The vector quota is enforced under the index write lock so an insert is counted exactly once and overwrites stay free; the disk quota counter is shared across shards so the limit is global per tenant. New public surface:VLog::tenant,TenantView,SharedTenantDisk,new_shared_disk(skeg-core);TenantLimits,TenantVectorQuota(skeg-server). -
SKEG.QUOTA.SET/SKEG.QUOTA.GETadmin commands. An operator can set a tenant’s quotas at runtime over RESP3:SKEG.QUOTA.SET <tenant> <max_vectors> <max_disk_bytes>(*= unlimited), and read them back withSKEG.QUOTA.GET <tenant>. The commands require an admin connection; the multi-tenant binary designates the admin tenant with--admin-tenant <name>and persists the limits in a sidecar next toauth.kdb, so they survive a restart.
Changed
-
Single-tenant and anonymous traffic is unchanged. With no limit configured nothing is counted and the write path is byte-identical to before; the per-tenant accounting adds no measurable overhead on the single-tenant path.
-
skeg_core::Errorandskeg_resp3::Commandgained variants (Error::DiskQuota;Command::SkegQuotaSet/SkegQuotaGet). Code that matches these enums with a wildcard arm is unaffected; an exhaustive match must add the new arms. This is whyskeg-coreandskeg-resp3take a breaking version bump.
Versions bumped
skeg-core0.3.0,skeg-resp30.2.0,skeg-server0.4.0,skeg-server-tenant0.2.0,skeg-vector0.1.4