Skip to content

[finding] os migrate resume lists an interrupted recorded-by run as resumable: true, then refuses it PLAN_CHANGED when the run had committed a chunk or used a non-default --chunk-size #21528

Description

@objectstack-fleet

Filing gate: ① a defect with a named position, a finding of class (a).

What happens (measured, public door)

Once PR #21527 composes the migration-plans registry and the plan's owner registers it, os migrate resume reaches the runner. It then refuses two kinds of interrupted recorded-by run:

  1. a run that committed one chunk before it was interrupted (203 sentinel rows, killed in chunk 1);
  2. a run started with --chunk-size 2 (3 rows, killed in chunk 0).

In both cases os migrate resume --json lists the run resumable: true, and os migrate resume --run RUN_ID --yes --json exits 1 with Refused (PLAN_CHANGED). The only recovery today is re-running --apply.

Why (read by the dev from source)

  • The plan's load() (packages/metadata-protocol/src/migrations/recorded-by-sentinel.ts) selects only the rows that still hold the sentinel. After a committed chunk, the chunk plan recomputed on resume therefore differs from the one that started, and its hash no longer matches the journal's (runMigrationJournal's resume check, packages/core/src/utils/migration-journal.ts).
  • Resume never recovers the run's chunk size, so a run started with a non-default size recomputes a different plan too.
  • ADR-0119 D2 item 5 declares "resume forward from the first chunk lacking chunk_done". The list's resumable: true promises what the act refuses.

Direction (⛔ not a ruling)

Either the plan's identity survives its own progress (a plan whose load() shrinks as it runs must hash on what it was started over, and the run's chunk size must come back from the journal), or the list mode stops calling such a run resumable. Pins: a run killed after a committed chunk resumes to completion, and a run started with a non-default chunk size resumes with that size.

Dedupe

MCP search_issues, repo-scoped, open and closed: 「migrate resume PLAN_CHANGED recorded-by chunk size plan hash mismatch」 gave 5 hits: #21498 (this finding's source; composition only) and 4 closed os migrate plan cards on other subjects. None covers this.

Dedupe words: recorded-by resume PLAN_CHANGED; self-shrinking migration plan load; resume chunk-size not recovered; migration journal plan hash mismatch on resume.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:devpathThe road — create, dev, verify, publish/install, connect an agent, iteratebugSomething isn't workingdomain:enginepriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions