RELEASE 14 June 2026

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. VLog gains a tenant(id) view that scopes cache residency and disk accounting to a tenant; the per-tenant disk total is rebuilt from the index on restart. A TenantBackend::limits(tenant) hook lets a deployment cap a tenant’s vector count (max_vectors, checked on SKEG.VSET) and its on-disk KV bytes (max_disk_bytes, checked on SET); 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.GET admin 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 with SKEG.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 to auth.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::Error and skeg_resp3::Command gained 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 why skeg-core and skeg-resp3 take a breaking version bump.

Versions bumped

  • skeg-core 0.3.0, skeg-resp3 0.2.0, skeg-server 0.4.0, skeg-server-tenant 0.2.0, skeg-vector 0.1.4