Repository navigation
Conversation
Promote prefix totals beyond the safe integer range without losing bytes, and preserve correct display and sorting. Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
A folder calculation could fail when the total exceeded JavaScript's safe integer limit, even when the object count was within the existing scan limit. For example, 2,048 objects of 4 TiB each exceed that limit. Accumulation now retains the fast number path for safe totals and switches to BigInt before precision is lost. Human-readable formatting and mixed number/BigInt sorting support large totals.
The scan remains bounded to 100 pages or 100,000 current objects; this change does not provide billion-object statistics. The separate near-real-time backend index work is tracked in rustfs/backlog#2990.
Type of Change
Testing
At commit
8163153dc2bf74c5e7bd1eec67234bc783cd168d, Node 22.23.4 / pnpm 12.3.4:All passed; the full suite ran 891 tests. Coverage includes the safe-integer boundary, invalid object sizes, 2,048 large objects, formatting and ascending/descending mixed-type TanStack sorting. Independent review found no supported correctness issue.
In an isolated headless Chrome run, 100 pages of synthetic S3 XML with 1,000 objects per page were processed, the page displayed 488.3 PiB, and cancellation was checked separately with an intentionally delayed request. This is not a production load test or a billion-object measurement. The browser's sampled JS heap and timing are not guaranteed peak or production performance measurements.
Checklist
Related Issues
Related to rustfs/rustfs#9082 and rustfs/backlog#2990.
Screenshots (if applicable)
Same synthetic source and desktop viewport: the baseline fails after the second page; the fix completes 100 pages. The screenshots use test data only.
Mobile result.
Additional Notes
The displayed unit remains rounded to one decimal place; totals and sorting are kept precise. Large-scale near-real-time indexing requires separate bucket/prefix authorization, completeness, persistence and recovery validation before it can replace this bounded calculation.