Skip to content

fix: use accountinfo for bucket statistics#158

Merged
cxymds merged 1 commit into
rustfs:mainfrom
marshawcoco:fix/accountinfo-bucket-stats
Jul 11, 2026
Merged

fix: use accountinfo for bucket statistics#158
cxymds merged 1 commit into
rustfs:mainfrom
marshawcoco:fix/accountinfo-bucket-stats

Conversation

@marshawcoco

@marshawcoco marshawcoco commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Description

Windows trace evidence showed the bucket list receiving complete accountinfo statistics while datausageinfo was still partial. The Console displayed the partial values because both bucket-list implementations sourced object count and size exclusively from datausageinfo.

This change makes accountinfo.buckets authoritative for bucket object count and size in both the browser root and shared bucket-list component. It reuses the account information already loaded by the permissions context, refreshes that snapshot when the user presses Refresh, preserves valid empty-bucket zero values, and shows unavailable values instead of fabricating zero for missing or malformed statistics. datausageinfo remains available for deployment-wide usage and scanner-oriented views.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test improvements
  • Security fix

Testing

  • Unit tests added/updated
  • Manual testing completed
npx -y node@22 --test tests/lib/*.test.js
npx -y node@22 /usr/bin/corepack pnpm type-check
npx -y node@22 /usr/bin/corepack pnpm lint
npx -y node@22 /usr/bin/corepack pnpm format:check
npx -y node@22 /usr/bin/corepack pnpm build

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • TypeScript types are properly defined
  • All commit messages are in English (Conventional Commits)
  • All existing tests pass
  • No new dependencies added, or they are justified

Related Issues

Fixes #159.

Related to rustfs/rustfs#3775.

Screenshots (if applicable)

The visual symptom and request-level evidence are documented in rustfs/rustfs#3775 and #159.

Additional Notes

The Windows trace captured complete accountinfo values (1600 objects / 209715200 bytes) and partial datausageinfo values (1502 objects / 196870144 bytes) during the same cold load; the Console displayed the latter exactly. A subsequent datausage refresh converged, which explains why the existing Refresh action appeared to repair the page.

RustFS PR rustfs/rustfs#4698 separately prevents incomplete distributed listings from being accepted by backend usage refreshes. This PR fixes the Console contract independently by using the per-account bucket statistics returned for that purpose instead of selecting a scanner-derived deployment usage snapshot for bucket rows.

@cxymds cxymds merged commit ceea725 into rustfs:main Jul 11, 2026
6 checks passed
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.

Bucket list displays partial datausageinfo statistics instead of accountinfo values

2 participants