move: rename --create-sentinel to --defer-cutover - #1158
Conversation
Move's --create-sentinel flag does the same thing as migrate's --defer-cutover: it creates _spirit_sentinel and blocks before cutover until an operator drops it. Unify on the migrate name so the two commands read the same way. The Go field Move.CreateSentinel (and check.Resources.CreateSentinel) is renamed to DeferCutOver to match migration.Migration.DeferCutOver. No backward-compatible alias is kept for the old flag name. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR unifies Move’s sentinel flag naming with Migrate by renaming --create-sentinel to --defer-cutover, and carries that rename through Move’s config struct, runner wiring, documentation, and tests to reduce cross-command friction.
Changes:
- Renames the Move CLI flag and Go field from
create-sentinel/CreateSentineltodefer-cutover/DeferCutOver(no compatibility alias). - Updates Move runner call sites and check resources wiring to use the new field name.
- Updates Move docs and tests to reference
defer-cutover.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/move/move.go | Renames the Kong flag/field to --defer-cutover / DeferCutOver. |
| pkg/move/runner.go | Updates sentinel creation condition and check resource wiring; updates a related comment. |
| pkg/move/check/check.go | Renames Resources field to DeferCutOver. |
| docs/move.md | Renames the configuration section/anchor and references to defer-cutover. |
| pkg/move/README.md | Updates internal Move package docs to refer to DeferCutOver. |
| pkg/move/sentinel_test.go | Updates test description and Move struct usage to DeferCutOver. |
| pkg/move/runner_test.go | Updates tests to use DeferCutOver and adjusts related comments. |
| pkg/move/move_test.go | Updates tests to use DeferCutOver. |
| pkg/move/move_sharded_test.go | Updates sharded move test to use DeferCutOver. |
| pkg/move/checksum_invariant_test.go | Updates checksum invariant test harness to use DeferCutOver. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Both from PR review feedback; neither is a logic change. docs/move.md told operators recovering from a too-old checkpoint to wipe `_spirit_checkpoint`, but move's checkpoint table is `_spirit_move_checkpoint`. The distinct name is deliberate (see pkg/move/README.md) — following the old text would drop the wrong table and hit the same failure on the next run. The comment above sentinel.Create claimed "a resume recreates it". It does not: sentinel.Create is only reached from newCopy. A resume does not need to recreate it — the sentinel lives on the target and survives, and the existence-driven sentinel.Wait blocks again. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
🤖 Review findings - created by Kiran's code review agent - for spirit/pull/1158, 10c3afb. Verdict: 1 finding — non-blocking (pre-existing dead field surfaced by the rename); otherwise clean, approve. Non-blocking
General suggestions
The one thing that could have broken, verifiedThe riskiest mechanism is whether the resume path still correctly waits-or-doesn't-wait on the sentinel after the rename touched the surrounding comment and field. Traced the dispatch in Verified correct
This review was generated by Claude Code (claude-sonnet-5). |
Move's
--create-sentineldoes the same thing as migrate's--defer-cutover: it creates_spirit_sentineland blocks before cutover until an operator drops it. Two names for one concept is needless friction for anyone who uses both commands, so this unifies on the migrate name.The Go field
Move.CreateSentinel(andcheck.Resources.CreateSentinel) is renamed toDeferCutOverto matchmigration.Migration.DeferCutOver.No backward-compatible alias is kept —
--create-sentinelis now an unknown-flag error.Changes
pkg/move/move.go— flag and field rename. Help text reworded to match migrate's framing: "Defer cutover (and continuous checksum) until the sentinel table on the first target database is dropped".pkg/move/check/check.go—Resources.DeferCutOver.pkg/move/runner.go— call sites and a comment.docs/move.md— section heading, TOC entry and anchor, prose. Alphabetical position in the config list is unchanged (checkpoint-max-age→defer-cutover→defer-secondary-indexes).pkg/move/README.mdand thepkg/movetests.TestCreateSentinelTableIdempotentkeeps its name: it testssentinel.Createidempotency, not the flag.Testing
go build ./...andgo vet ./...clean;golangci-lint run ./pkg/move/...reports 0 issues.TestMoveSentinelDropReleasesCutoverandTestCreateSentinelTableIdempotentpass against a local MySQL 9.7. The fullpkg/movesuite is left to CI.🤖 Generated with Claude Code