#1769·gh-ost

`--resume` without `--execute` drops the ghost table it correctly skipped altering

Author: ajm188Created Sep 18, 2026Updated Sep 18, 2026

Description

Running a checkpoint/resume migration with gh-ost --resume but without --execute (i.e. a dry-run resume) correctly skips re-applying the ALTER to the ghost table, but finalCleanup still drops the ghost table at the end, destroying the progress from the interrupted real migration.

Steps to reproduce

  1. Start a migration with --checkpoint and --execute.
  2. Interrupt it partway through row copy.
  3. Resume with --resume but omit --execute (dry-run resume).
  4. Observe the ghost table is dropped even though no data was copied or altered in this run.

Expected behavior

A dry-run resume should not destroy the ghost table produced by the previous real run, since it did none of the work that produced it and a subsequent --resume --execute should still be able to use it.

Root cause

In finalCleanup (go/logic/migrator.go), the ghost table drop is gated only on migrationContext.Noop, not on whether this is a resume:

if mgtr.migrationContext.Noop {
    mgtr.applier.DropGhostTable()
}

This doesn't account for Resume=true, where the ghost table was not created by this invocation and represents real, previously-copied data.

Workaround

Skip the dry-run resume step; go straight to --resume --execute.