Skip to content

fix(admin): distinguish unavailable cluster counts - #343

Merged
houseme merged 1 commit into
mainfrom
houseme/fix-5899-unavailable-stats
Aug 12, 2026
Merged

fix(admin): distinguish unavailable cluster counts#343
houseme merged 1 commit into
mainfrom
houseme/fix-5899-unavailable-stats

Conversation

@houseme

@houseme houseme commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Related Issues

Problem

rc admin info cluster prints the numeric count fields even when RustFS explicitly marks bucket or object statistics as unavailable. Because unavailable counts are encoded with a zero placeholder plus an error, the human-readable output incorrectly presents unknown values as real zero counts.

Solution

  • Display unavailable for bucket and object counts when the corresponding server error is non-empty.
  • Preserve real zero counts when no error is present.
  • Keep the existing JSON v2 output contract unchanged.
  • Add a mock-admin integration test covering the server response reported by Still issues with meta data of buckets in bucket overview rustfs#5899.

Verification

  • cargo fmt --all --check
  • cargo test -p rustfs-cli --lib 'commands::admin::info::tests' — 11 passed.
  • cargo test -p rustfs-cli --test admin_info — 4 passed.
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace
  • git diff --check

All checks passed.

Impact

Human-readable cluster information no longer misrepresents unavailable bucket and object statistics as empty clusters. Successful counts, exit codes, requests, and JSON output remain compatible.

Additional Notes

The companion server PR allows a complete live bucket namespace count to remain available while the authoritative object and usage snapshot is rebuilding. This CLI PR independently handles unavailable fields from current and older compatible RustFS responses.

Co-Authored-By: heihutu <heihutu@gmail.com>
@houseme
houseme merged commit d46ca05 into main Aug 12, 2026
17 checks passed
@houseme
houseme deleted the houseme/fix-5899-unavailable-stats branch August 12, 2026 17:38
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