Skip to content

fix(quota): accept unavailable bucket usage - #397

Merged
overtrue merged 1 commit into
mainfrom
overtrue/fix-quota-unknown-usage
Nov 2, 2026
Merged

overtrue merged 1 commit into
mainfrom
overtrue/fix-quota-unknown-usage

Conversation

@overtrue

@overtrue overtrue commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Related Issues

Refs rustfs/backlog#2951 and rustfs/rustfs#8832.

Summary of Changes

RustFS can return size: null when bucket usage is unavailable. The quota PUT already succeeds, but rc rejects the response as an invalid u64 and exits before SNW-110 can test extraction. Accept unavailable usage in the admin model, display unknown in text output, and preserve null in JSON. Known zero and positive usage keep their existing values.

Verification

  • cargo +1.99.0 test --workspace --offline: 2690 passed, 2 existing ignored tests. New coverage calls set/info/clear over HTTP with size: null and checks JSON preserves unknown versus zero.
  • The new core regression fails on the base with invalid type: null, expected u64, then passes with this change.
  • cargo +1.99.0 clippy --workspace --offline -- -D warnings, cargo +1.99.0 fmt --all --check and git diff --check pass.
  • Tested commit: b8951aa.

Impact

BucketQuota.size becomes Option. JSON usage and usageHuman can be null; successful numeric responses keep their existing shape. This fixes set, info and clear against servers that report unavailable usage. Functional SNW-110 acceptance requires installing the updated rc binary on the runner.

Additional Notes

Sequential contract and failure-path reviews covered deserialization, all three quota operations, unknown versus zero, and output compatibility. Revert this commit to restore the previous response handling.

@overtrue
overtrue merged commit 839b651 into main Nov 2, 2026
17 checks passed
@overtrue
overtrue deleted the overtrue/fix-quota-unknown-usage branch November 2, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant