A pass that died mid-rekey had already advanced the main cursor past
the bd-578h9.4 watershed, so the next MigrateUp read the lineage as a
converged fresh clone: it skipped the rewrite, recorded marker 0009
over partially re-keyed rows, and the rekey never completed - the
un-rekeyed rows kept their per-clone-random 0037 ids and the merge
duplicates the pass exists to fix came back.
The rekey now records a clone-local in-progress sentinel in
local_metadata (dolt-ignored; created by main migration 0029, which is
always applied before the rekey runs) before its first UPDATE and
clears it only after the last table completes. A pending sentinel
overrides the fresh-clone skip, so the next pass resumes the idempotent
rewrite. MigrateUp also treats the aux tables as migration-owned when
resuming: their partial-rekey dirt is exempted from the
changed-signature guard (the resume is about to change them) and staged
into the pass's commit instead of being left to the autocommit net.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>