Skip to content

feat(observability): report the post-copy verify pass as its own engine state - #964

Draft
aparajon wants to merge 1 commit into
mainfrom
armand/engine-checksum-state
Draft

feat(observability): report the post-copy verify pass as its own engine state#964
aparajon wants to merge 1 commit into
mainfrom
armand/engine-checksum-state

Conversation

@aparajon

@aparajon aparajon commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Why this matters

The post-copy verify pass compares the copied data against the source before cutover, and on a large table it runs for hours. It has no way to cross the engine interface: engine.State has no checksum member, and progressState returns the tracked state without consulting the engine's phase at all, so every post-copy phase flattens to Running.

Everything downstream is already built for it — the checksumming task state, its proto enum, the PR comment, the CLI, the aggregate counter and the previews all handle a verifying table. The state simply never arrives to populate them, so the operator watches a full copy bar with no ETA and nothing saying a verification is under way.

What it does

Adds StateChecksumming and turns progressState into an explicit engine-phase to engine-state mapping. Phases that flatten into the tracked state are listed rather than left to a default, so giving one of them its own vocabulary is a decision made in that mapping. The secondary-index rebuild is the next candidate: same shape of invisible multi-hour phase.

Stacks on top of the display-side work — this is the producing half.

🤖 Generated with Claude Code

Copilot AI lite review requested due to automatic review settings August 7, 2026 19:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves operator observability of long-running Spirit schema changes by surfacing the post-copy verify pass as a distinct engine state (checksumming) and fixing Spirit table progress projection so verify-phase counters and details are rendered correctly after row copy completes.

Changes:

  • Add engine.StateChecksumming and map Spirit’s status.Checksum phase to that state via an explicit phase→engine-state mapping.
  • Fix Spirit table progress rendering to treat IsComplete as “row copy complete” (not “table complete”), retire copy ETA after copy completion, and project runner-wide checksum counters/details during verify.
  • Extend tern state conversion + tests to persist checksumming as a canonical task state and validate state aggregation behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/tern/state_converters.go Persists the new engine checksumming state as canonical task state (state.Task.Checksumming).
pkg/tern/state_converters_test.go Adds coverage asserting checksumming is in-flight and aggregates to an in-flight apply state.
pkg/engine/spirit/spirit.go Projects Spirit verify phase into engine state and corrects table progress/detail behavior past row copy completion.
pkg/engine/spirit/spirit_test.go Adds tests covering checksumming state surfacing and verify-pass table progress projection.
pkg/engine/engine.go Introduces StateChecksumming as a first-class engine state (non-terminal).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 31 to 36
return state.Task.Pending
case engine.StateRunning:
return state.Task.Running
case engine.StateChecksumming:
return state.Task.Checksumming
case engine.StateWaitingForDeploy:
…ne state

Spirit's verify pass compares the copied data against the source before
cutover and runs for hours on a large table. It had no way to cross the
engine interface: engine.State has no checksum member, and progressState
returned the tracked state without consulting Spirit's phase at all, so
every post-copy phase flattened to Running. The task state, its proto
enum and every renderer are already in place — the state simply never
arrived to populate them, so the operator watched a full copy bar with
no ETA and nothing saying a verification was under way.

progressState becomes an explicit Spirit-phase to engine-state mapping.
Phases that flatten into the tracked state are listed rather than left to
a default, so giving one of them its own vocabulary is a decision made in
that mapping. The secondary-index rebuild is the next candidate: it is the
same shape of invisible multi-hour phase.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@aparajon
aparajon force-pushed the armand/engine-checksum-state branch from 249545b to 22939d5 Compare August 7, 2026 19:21
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.

2 participants