Skip to content

fix(console): prevent pool volume count overflow - #223

Draft
GatewayJ wants to merge 1 commit into
rustfs:mainfrom
GatewayJ:agent/fix-1095-pool-volume-overflow
Draft

fix(console): prevent pool volume count overflow#223
GatewayJ wants to merge 1 commit into
rustfs:mainfrom
GatewayJ:agent/fix-1095-pool-volume-overflow

Conversation

@GatewayJ

@GatewayJ GatewayJ commented Aug 5, 2026

Copy link
Copy Markdown
Member

Type of Change

  • New Feature
  • Bug Fix
  • Documentation
  • Performance Improvement
  • Test/CI
  • Refactor
  • Other:

Related Issues

Fixes rustfs/backlog#1095

Summary of Changes

  • widen PoolDetails.total_volumes to i64
  • widen both pool dimensions before multiplication so the result cannot overflow
  • reuse the same derivation in list and add-pool response paths
  • document the widened OpenAPI contract and add overflow regression coverage

Checklist

  • I have read and followed the CONTRIBUTING.md guidelines
  • Passed make pre-commit (fmt-check + clippy + test + console-lint + console-fmt-check)
  • Added/updated necessary tests
  • Documentation: N/A; the generated OpenAPI contract is covered by a schema test
  • CHANGELOG: N/A; this is a focused correctness fix
  • CI/CD passed (pending GitHub Actions)

Impact

  • Breaking change (CRD/API compatibility)
  • Requires doc/config/deployment update
  • Other impact: OpenAPI widens total_volumes from int32 to int64; the JSON field remains numeric

Verification

make pre-commit

Additional Notes

Every i32 * i32 result fits exactly in i64, so widening preserves the real volume count without clamping. Values above JavaScript's safe-integer range remain a theoretical client-side limitation; changing the field to a string would break the existing Console contract and is outside this fix.


Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md) and sign the CLA if this is your first contribution.

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