#497: instance cap measures under the storage root; quota.enabled=false really disables #505

Merged
Cordy merged 7 commits from fix-497 into main 2026-09-12 16:34:58 +00:00
Owner

Closes #497.

  • maxTotalBytes now measures bytes stored under the storage root via the same cached tree walk as perUserBytes (30s TTL), instead of the whole filesystem's statfs — on a shared volume the old check tripped always or never. Works on every backend, no Usager needed.
  • Admin storage meter (Usage()) reports the same under-root figure when an instance cap is set; reserveBytes keeps its statfs free-space-floor meaning.
  • storage.quota.enabled is now tri-state (*bool): explicit false keeps the decorator out of the chain entirely (admin-set caps inert); absent keeps the always-installed behaviour (#178).

TDD: TestInstanceCapMeasuresUnderRoot, TestInstanceCapIgnoresSharedDiskUsage, TestInstanceCapUsageReportsUnderRoot witnessed red on the runner before the fix; TestMaxTotalBytes retired (superseded), TestCapacityGuardSkippedWithoutUsager retargeted at ReserveBytes only; new TestQuotaEnabledTriState. Full suite green.

Closes #497. - `maxTotalBytes` now measures bytes stored **under the storage root** via the same cached tree walk as `perUserBytes` (30s TTL), instead of the whole filesystem's statfs — on a shared volume the old check tripped always or never. Works on every backend, no Usager needed. - Admin storage meter (`Usage()`) reports the same under-root figure when an instance cap is set; `reserveBytes` keeps its statfs free-space-floor meaning. - `storage.quota.enabled` is now tri-state (`*bool`): explicit `false` keeps the decorator out of the chain entirely (admin-set caps inert); absent keeps the always-installed behaviour (#178). TDD: `TestInstanceCapMeasuresUnderRoot`, `TestInstanceCapIgnoresSharedDiskUsage`, `TestInstanceCapUsageReportsUnderRoot` witnessed red on the runner before the fix; `TestMaxTotalBytes` retired (superseded), `TestCapacityGuardSkippedWithoutUsager` retargeted at `ReserveBytes` only; new `TestQuotaEnabledTriState`. Full suite green.
Cordy merged commit c804be0f89 into main 2026-09-12 16:34:58 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#505
No description provided.