Skip to content

fix: allow restarting stopped pool rebalances - #273

Merged
cxymds merged 1 commit into
mainfrom
cxymds/fix-rebalance-stopped-state
Oct 19, 2026
Merged

cxymds merged 1 commit into
mainfrom
cxymds/fix-rebalance-stopped-state

Conversation

@cxymds

@cxymds cxymds commented Oct 19, 2026

Copy link
Copy Markdown
Member

Pull Request

Description

A retained rebalance task with pool states Stopped / None / None was summarized as an empty state, then treated as starting because its historical task ID still existed. This displayed an enabled Stop button and hid Start; clicking Stop produced pool rebalance is not started.

Recognize stopped pool states when deriving the overall state, restoring Stopped and Start Rebalance while preserving historical progress. Keep running, stopping, and failure precedence unchanged, and retain the starting state for a new start response containing only an ID.

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

Added 11 regression cases covering historical stopped runs with and without stoppedAt, stopped/unused/completed mixtures, active-state precedence, stop aliases, retained progress, and new task IDs. The focused suite passed all 25 tests; seven stopped-state cases failed against the original implementation. The full suite passed all 787 tests.

nvm use v22
pnpm install --frozen-lockfile
node --experimental-strip-types --test --test-reporter=spec tests/lib/pool-operations.test.js
pnpm type-check
pnpm lint
pnpm format:check
pnpm test:run
git diff --check

Browser interaction checks used the actual local Next.js page with mocked API responses, without connecting to a storage cluster. Clicking Start issued exactly one POST /rustfs/admin/v3/rebalance/start and no stop request; the subsequent status response containing a new ID and a Started pool, without a top-level status, displayed Running. Running/stopping/error/loading states prevented another start, while idle allowed it. Desktop/mobile, Chinese, and dark mode were visually checked. No page exceptions occurred; the existing avatar sizing warning and the intentionally injected HTTP 500 were observed.

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

Closes rustfs/rustfs#8689

Screenshots (if applicable)

Actual Console rendering with illustrative mocked API data; these screenshots are UI regression evidence, not live-cluster acceptance. Each before/after pair uses the same stopped-task response and viewport. Image assets are stored on a separate evidence branch and are not included in this PR's source diff.

View Before After
Desktop, 1440 x 1080 Before: Starting with Stop After: Stopped with Start
Mobile, 390 x 844, full page Before on mobile After on mobile

Additional Notes

Independent correctness/simplification review and browser/UX validation found no issues. The change is confined to Console state derivation; no server API or storage behavior changes. Reverting this commit restores the prior UI behavior.

@cxymds
cxymds merged commit 1c9cd78 into main Oct 19, 2026
10 checks passed
@cxymds
cxymds deleted the cxymds/fix-rebalance-stopped-state branch October 19, 2026 03:34
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.

pool rebalance cannot be started / shows "停止平衡" (Rebalance Stopped)

1 participant