fix(github): keep a multi-table apply Running while tables are still queued - #1136
Merged
Conversation
…queued DeriveApplyState named a post-copy phase (catching up, checksumming, post-checksum) whenever one task reached it and no sibling was copying — including when the remaining siblings had not started at all. A sequential multi-table apply whose first table entered its checksum then reported the whole apply as Checksumming, overstating progress on the CLI status list and the PR comment while most of its tables were still queued. Phase names now surface only once every table has started: while any task is still pending alongside an active phase task, the apply stays Running. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR keeps multi-table apply status as Running while post-copy work coexists with queued tables.
Changes:
- Adds the queued-work projection rung to
DeriveApplyState. - Adds regression coverage for mixed table states.
- The equivalent remote/gRPC projection still requires the same update.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Summary |
|---|---|
pkg/state/apply.go |
Adds the local queued-work projection, but the remote progress path can still report overstated post-copy phases. |
pkg/state/apply_test.go |
Covers queued and mixed post-copy state combinations. |
Suppressed comments (1)
pkg/state/apply.go:109
- The projection contract is also described in
docs/spirit_progress.md:181-190, which still says the phase is surfaced once every active table is draining/verifying and does not mention queued tables. After this change that documentation gives the wrong rationale for the{checksumming, pending}case; please update the canonical progress documentation alongside the code comment.
// The post-copy phases (13–15) surface the least-advanced active phase, and
// only once every table has started: while any table is still copying rows —
// or still queued with its whole copy ahead of it — the apply is Running.
// Once every table has at least begun and the active ones are draining or
// verifying, the apply names that phase.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…tion The data plane's overall-state projection mirrors the apply-state ladder: a post-copy phase surfaces only once every table has started, so a remote apply with queued tables reports Running instead of naming one task's phase. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aparajon
marked this pull request as ready for review
August 25, 2026 16:01
aparajon
requested review from
JashLal,
Kiran01bm,
eeSeeGee,
jayjanssen,
jemiahw and
morgo
as code owners
August 25, 2026 16:01
morgo
approved these changes
Aug 25, 2026
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.
Why
DeriveApplyStatenamed a post-copy phase (catching up, checksumming, post-checksum) whenever one task reached it and no sibling was copying — including when the remaining siblings had not started at all. A sequential multi-table apply whose first table entered its checksum reported the whole apply as Checksumming on the CLI status list and the PR comment status line, overstating progress while most of its tables were still queued with their entire copy ahead of them.What
Phase names now surface only once every table has started. One new rung in the projection ladder, between
Runningand the phase names:{checksumming, pending ×10}{completed, catching_up, pending}{checksumming}{completed, checksumming}{running, checksumming, pending}{pending, pending}The rung is the named predicate
postCopyPhaseWithQueuedWork. The data plane's overall-state projection (deriveOverallState), which remote-mode applies report over gRPC and the control plane persists, applies the same rung so both drive modes agree. Only the projected label changes: phase tasks already counted as running-family for activity and stuck detection, so no gate or safety semantics move.This PR was generated by Claude Code (claude-fable-5).