Repository navigation
fix(pools): remove redundant hot-reload panel from decommission, add stripe geometry & failure alerts - #338
Merged
Merged
Conversation
…stripe geometry & failure alerts
loverustfs
requested review from
houseme,
majinghe and
overtrue
and
a balanced review from Copilot
December 5, 2026 02:32
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Failed maintenance-status reads can enable unsafe decommissioning or rebalancing, while 403 responses still redirect away from views intended to remain available.
3 open issues
What changed in this PR
Improves the Console’s pool lifecycle pages with consistent stripe geometry, clearer failure reporting, and operation-conflict guards.
Changes:
- Removes the decommission maintenance panel and adds completion guidance.
- Displays stripe geometry and persistent failure/conflict alerts.
- Adds seven messages across 15 locales and expands regression coverage.
| File | Description |
|---|---|
| tests/lib/pool-maintenance.test.ts | Tests geometry matching and formatting. |
| tests/lib/pool-maintenance-components.test.ts | Tests geometry rendering and failure alerts. |
| tests/lib/pool-expand-page.test.js | Updates page integration assertions. |
| tests/lib/pool-decommission-page.test.js | Checks panel removal and new alerts. |
| tests/lib/pool-decommission-load.test.ts | Tests maintenance-read failure handling. |
| lib/pool-operations.ts | Adds shared geometry helpers. |
| lib/pool-decommission-load.ts | Loads optional maintenance status. |
| i18n/locales/zh-TW.json | Adds Traditional Chinese messages. |
| i18n/locales/zh-CN.json | Adds Simplified Chinese messages. |
| i18n/locales/vi-VN.json | Adds Vietnamese messages. |
| i18n/locales/tr-TR.json | Adds Turkish messages. |
| i18n/locales/ru-RU.json | Adds Russian messages. |
| i18n/locales/pt-BR.json | Adds Brazilian Portuguese messages. |
| i18n/locales/ko-KR.json | Adds Korean messages. |
| i18n/locales/ja-JP.json | Adds Japanese messages. |
| i18n/locales/it-IT.json | Adds Italian messages. |
| i18n/locales/id-ID.json | Adds Indonesian messages. |
| i18n/locales/fr-FR.json | Adds French messages. |
| i18n/locales/es-ES.json | Adds Spanish messages. |
| i18n/locales/en-US.json | Adds English messages. |
| i18n/locales/de-DE.json | Adds German messages. |
| i18n/locales/ar-MA.json | Adds Arabic messages. |
| components/pools/maintenance-panel.tsx | Adds persistent errors and detailed validation feedback. |
| app/(dashboard)/rebalance/page.tsx | Adds geometry, conflict guards, and failure alerts. |
| app/(dashboard)/pool-expand/page.tsx | Displays geometry in tables and mobile cards. |
| app/(dashboard)/pool-decommission/page.tsx | Removes maintenance panel; adds geometry and lifecycle alerts. |
Review effort: Balanced
| className={className} | ||
| disabled={!canStartDecommission(row, selectionLocked, activePoolCount) || interactionLocked} | ||
| disabled={ | ||
| !canStartDecommission(row, selectionLocked, activePoolCount) || interactionLocked || maintenanceActive |
| ) | ||
| const canStart = | ||
| !interactionLocked && | ||
| !maintenanceActive && |
| const view = await getRebalanceViewModel() | ||
| const [viewResult, maintenanceResult] = await Promise.allSettled([ | ||
| getRebalanceViewModel(), | ||
| getMaintenanceStatus(), |
overtrue
requested changes
Dec 5, 2026
overtrue
left a comment
Collaborator
There was a problem hiding this comment.
Requesting changes on 265881a:
- Missing
suppress403Redirect: true(hooks/use-pool-operations.ts:148-151):getMaintenanceStatus()callsapi.get("/pools/maintenance/status")without{ suppress403Redirect: true }(unlike its 5 sibling methods), causinglib/api-client.tsto redirect/rebalanceor/pool-expandusers lacking maintenance-read permission straight to/403/beforePromise.allSettledcan degrade gracefully. - Fail-open maintenance guards (
lib/pool-decommission-load.ts,app/(dashboard)/pool-decommission/page.tsx,app/(dashboard)/rebalance/page.tsx): RejectedgetMaintenanceStatus()calls resetmaintenanceStatustonull(maintenanceActive = false), enablingStart Decommission/Start Rebalancewhen maintenance state is unverified and wiping out an already-detectedactive: trueblock on transient 5s poll/sync failures. Fail closed (or handle403explicitly without clearing known active maintenance) and surface an unavailable alert.
overtrue
requested changes
Dec 5, 2026
overtrue
left a comment
Collaborator
There was a problem hiding this comment.
Holding CHANGES_REQUESTED on 265881a0: no new commits since the prior review; suppress403Redirect and fail-closed maintenanceStatus blockers remain unaddressed.
…tus errors Address PR #338 review blockers: - Pass { suppress403Redirect: true } in usePoolOperations.getMaintenanceStatus() so optional maintenance-status reads on /rebalance, /pool-decommission, and /pool-expand degrade locally without triggering global /403/ redirects. - Return settled maintenanceResult from loadPoolDecommissionData() instead of flattening rejections into null. - Fail closed in PoolDecommissionPage and RebalancePage by requiring a successfully loaded, inactive maintenance status before enabling Start Decommission / Start Rebalance (both button state and imperative handleStart guards), while keeping pool overviews and Stop/Cancel controls available. - Preserve previously detected active maintenance state and stripe geometry across transient poll/sync failures and surface a destructive Maintenance Status Unavailable alert with Refresh recovery. - Add targeted unit, source-safety, and mounted component regression tests covering 403 suppression, fail-closed gating, active blocker preservation, stale dialog confirmation guards, and refresh recovery.
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.


1. What Was Fixed
This PR cleans up pool lifecycle workflows and improves operational visibility across
/pool-expand,/pool-decommission, and/rebalance:/pool-decommission:<PoolMaintenancePanel mode="decommission" />fromapp/(dashboard)/pool-decommission/page.tsxso pool decommission focuses exclusively on pool draining/clearing without duplicating the hot-expansion maintenance workflow.Pool decommission completed) listing drained pool names that can be safely removed from cluster configuration while keeping surviving pools in order.formatPoolStripeGeometry()andfindPoolGeometry()helpers inlib/pool-operations.ts(matching active pool geometry by trimmed pool command line with numericpoolIndexfallback, formatting as{setCount} x {drivesPerSet} (EC:{dataDrives}+{parityDrives}), or--when unavailable).Promise.allSettledinlib/pool-decommission-load.ts,app/(dashboard)/pool-expand/page.tsx, andapp/(dashboard)/rebalance/page.tsxso maintenance-status read errors degrade gracefully without blocking page load.Erasure Stripe Geometrycolumn/field consistently in desktop tables, mobile cards, and the selected-pool summary banner across/pool-expand,/pool-decommission, and/rebalance, and reusedformatPoolStripeGeometry()insidecomponents/pools/maintenance-panel.tsx.actionError) incomponents/pools/maintenance-panel.tsx,app/(dashboard)/pool-decommission/page.tsx, andapp/(dashboard)/rebalance/page.tsxso backend validation, preflight, hot-reload, start/stop, and decommission errors remain clearly visible alongside toast notifications.configReport.errorsandpreflightReport.errors) directly inside check/preflight failure alerts inPoolMaintenancePanel.Failed Statusalerts when tracked decommission or rebalance tasks report backend failure messages./rebalanceand blocks rebalance start (checking bothpool.status === "decommissioning"anddecommissionStatus).ar-MA,de-DE,en-US,es-ES,fr-FR,id-ID,it-IT,ja-JP,ko-KR,pt-BR,ru-RU,tr-TR,vi-VN,zh-CN,zh-TW), cleanly rebased ontomain.2. Testing & Implementation Steps
Automated Verification
Rebased onto
origin/main(b6a829d), installed dependencies viapnpm install --frozen-lockfile, and ran the full Console verification suite:64/64passed):node --experimental-strip-types --import ./scripts/register-typescript-loader.mjs --test tests/lib/pool-*.test.{js,ts}tests/lib/pool-maintenance.test.ts: validatesformatPoolStripeGeometry()andfindPoolGeometry()(multi-set, single-set,cmdLinematch,poolIndexfallback, and empty/zeroed fallback).tests/lib/pool-decommission-load.test.ts: validates graceful degradation whengetMaintenanceStatus()rejects.tests/lib/pool-decommission-page.test.js: verifies/pool-decommissionexcludesPoolMaintenancePaneland surfaces stripe geometry and conflict/failure alerts.tests/lib/pool-expand-page.test.js: verifies/pool-expandintegrates single-pool support, permission gating, actual stripe geometry, and maintenance panel.tests/lib/pool-maintenance-components.test.ts: verifiesPoolExpandPagerendersErasure Stripe Geometry(1 x 16 (EC:12+4)) andPoolMaintenancePanelrenders visible destructive alerts on backend check, preflight, and hot-reload errors.1353/1353passed, includingi18n-locales.test.js):All matched files use Prettier code style!):37/37static routes built cleanly, including/pool-expand,/pool-decommission, and/rebalance):Live Console Verification Steps
/pool-expandon a cluster and verify each pool displays its actualErasure Stripe Geometry(e.g.,1 x 16 (EC:12+4)) in both desktop table and mobile card views./pool-expand, submit an invalid pool specification (e.g., mismatched stripe width or unreachable peer), and verifyCheck Configuration,Run Preflight Check, andExit Maintenance & Hot-Reloadsurface persistent inline destructive alerts with detailed backend error messages./pool-decommissionand/rebalanceand confirm the destructiveCluster maintenance mode is activealert is displayed and start actions are disabled./pool-decommission: confirm the redundant hot-reload maintenance panel is no longer rendered,Erasure Stripe Geometryis visible for every pool and in the selected pool header, and drained pools display thePool decommission completednotice./rebalancesurfaces thePool decommission is in progressalert and disables starting rebalance until decommission completes, while displaying stripe geometry uniformly across pools.3. Results & Conclusions
1353/1353unit tests (64/64pool-specific tests),type-check,lint,format:check, andnext build(37/37static routes)./pool-expand,/pool-decommission, and/rebalance, clear non-ephemeral inline diagnostics on backend or preflight failures, strict cross-workflow conflict feedback between maintenance/decommission/rebalance, and a cleaner/pool-decommissionpage without duplicate hot-reload controls.Checklist
1353/1353passing)