fix(github): show queued ready_to_complete shards as ready for cutover - #873
fix(github): show queued ready_to_complete shards as ready for cutover#873Kiran01bm wants to merge 3 commits into
Conversation
Vitess marks immediate operations (CREATE/DROP TABLE) ready_to_complete while their migration status is still queued. The deploy request state already counts those shards as waiting for cutover, but the per-shard display only honored ready_to_complete for running shards — so a table could render as ready to cut over while its shard summary line said "queued". Fold ready_to_complete into the displayed state for all pre-terminal statuses so the shard rows, table state, and deploy state agree.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
Aligns PlanetScale/Vitess per-shard progress display with the ready_to_complete cutover-readiness signal so shard rows, table state, and deploy request state don’t disagree for immediate operations that remain queued.
Changes:
- Extracts
effectiveShardStateto derive a display state that foldsready_to_completeinto all pre-terminal Vitess statuses. - Updates shard aggregation to use the derived state consistently.
- Adds/extends tests to cover queued-but-ready shards and the new helper.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/engine/planetscale/progress.go | Adds effectiveShardState and uses it during shard aggregation to ensure queued/requested/ready shards with ready_to_complete=1 display as ready_to_complete. |
| pkg/engine/planetscale/progress_test.go | Adds coverage for queued shards with/without ready_to_complete and unit-tests effectiveShardState. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Keep "migration_status" only as the literal Vitess column name; reword prose uses of "migration" and name the subtest after the expected ready_to_complete state.
|
🤖 Adversarial correctness review, requested by Armand and performed by his agent. Reviewed at head ed3cb9d. Verdict: correct and display-only — approving. FindingsThe fixture for the "stays queued" subtest feeds a raw status that Vitess never emits. Action items
Verified (tried to break, couldn't)
This review was generated by Claude Code (claude-fable-5). |
aparajon
left a comment
There was a problem hiding this comment.
🤖 Approving on Armand's behalf after the adversarial correctness review above (no blocking findings). This stamp was left by Claude Code (claude-fable-5).
Why this matters
On Vitess, some operations are ready to cut over before they ever start copying rows. CREATE TABLE and DROP TABLE are "immediate" operations — Vitess marks them
ready_to_complete=1while their migration status still saysqueued. The overall deploy state already understood this: it counted those shards as waiting for cutover. But the per-shard display only honored the readiness flag when the shard's status wasrunning.The result was a progress comment that disagreed with itself: the table line said ready to cut over, while the shard line right under it still said "queued". An operator deciding whether it's safe to issue the cutover command shouldn't have to guess which line is telling the truth.
What it does
Extracts an
effectiveShardStatehelper in the PlanetScale progress aggregation and foldsready_to_completeinto the displayed shard state for all pre-terminal Vitess statuses (running,queued,requested,ready). Terminal statuses (complete,failed,cancelled) keep precedence, sinceready_to_completecan remain set after a shard finishes or is cancelled. The table-level state inherits the fix, since it is derived from the resolved shard states.ready_to_completeis the authoritative cutover-readiness signal, and the deploy-state derivation already treats queued-but-ready shards as waiting for cutover. Resolving the displayed shard state from the same signal keeps the shard rows, the table state, and the deploy request state in agreement — no readiness or safety logic changes, display only.🤖 Generated with Claude Code