Repository navigation
Description
admin replicate resync status has two unhandled outcomes: human/TTY mode keeps spinning after site-level Failed, and disabled site replication returns success without any output in either human or JSON mode. These belong in one follow-up covering this command's state/output contract.
Confirmed on main at 18ea0a1ae04f69c7ae7c8f8b11329109ae7dcf71, after the fix for #49. Both paths are also present in mcli 20261025. Suggested priority: P2.
Failed terminal state. Use a local Admin API fixture with successful site/peer discovery, then stream the following from GET /minio/admin/v3/metrics, flushing the event and keeping the connection open:
{"hosts":["silo1"],"aggregated":{"siteResync":{"resyncID":"audit","resyncStatus":"Failed","deplID":"peer","startTime":"2026-10-26T00:00:00Z","lastUpdate":"2026-10-26T00:00:05Z"}},"final":false}Run mcli admin replicate resync status a b under a PTY, and run the same command with global --json as a control. Substitute Completed and Canceled as further controls:
| Site status | JSON | Human/PTY |
|---|---|---|
| Completed | Prints status, exits 0 | Prints status, exits 0 |
| Canceled | Prints status, exits 0 | Prints status, exits 0 |
| Failed | Prints status, exits 0 | Shows Failed but continues spinning; killed by test timeout |
A direct UI Update test independently confirms that Failed does not set quitting or return a quit command. The UI only handles Canceled and Complete(); JSON explicitly handles all three. SILO produces site-level Failed when every bucket has completed or failed. Bucket-level retry behavior is not evidence that this site-level status is still ongoing.
Disabled site replication. With an alias pointing to a SILO instance without site replication, run either:
mcli admin replicate resync status solo unused-peer
mcli --json admin replicate resync status solo unused-peerBoth exit 0 with empty stdout and stderr. This was reproduced against a real local SILO 20261018 server as well as a fixture returning {"enabled":false}. The command returns before peer lookup. The disabled branch calls Colorize but discards its return value.
Unify terminal-state classification between the streaming callback and UI, render the final state, and cancel the stream cleanly. Emit a meaningful disabled result in both output modes and define its exit semantics. A successful query returning Failed or Canceled need not itself exit nonzero; preserve the query/result distinction. Likewise, the disabled-state defect is silent output, not proof that exit 0 is inherently wrong.
Regression acceptance:
- Human/PTY and JSON cover Completed, Canceled, Failed, and a nonterminal state; terminal events must exit promptly even when the stream remains open.
- Failed is rendered as failure, not a success indicator; final output is not lost during shutdown.
- Disabled replication emits a human explanation or a parseable JSON result/error, with a deliberate exit policy and no peer/metrics request.
- Request/stream errors and interruption terminate cleanly. Preserve the JSON completion, cancellation, failure, final-event and request-error coverage added for admin replicate resync status --json prints nothing #49.
- Keep batch-job missing-metrics handling separate: its pending/persisted lifecycle differs from site resync.
Related: #51 covers partial start/cancel operation outcomes; #53 tracks the batch-job status lifecycle separately.
Activity
Fix client identity isolation and status reporting (pgsty#55)