Skip to content

Commit b68a807

Browse files
couple straggling issues from e2e testing
1 parent b203557 commit b68a807

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

go/logic/migrator.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2750,7 +2750,13 @@ func (mgtr *Migrator) iterateChunksMoveTables() error {
27502750
return err
27512751
}
27522752
// Record this table's last successfully-copied range for checkpointing.
2753-
mt.RecordLastIterationRange()
2753+
// Skip the final completion-detection pass: it advanced the iteration min
2754+
// to the previous max without copying anything (and set rowCopyComplete),
2755+
// so recording here would overwrite the real [min..max] span of the last
2756+
// actual chunk with a degenerate [max..max].
2757+
if !mt.IsRowCopyComplete() {
2758+
mt.RecordLastIterationRange()
2759+
}
27542760
return nil
27552761
}
27562762
return base.SendWithContext(mgtr.migrationContext.GetContext(), mgtr.copyRowsQueue, copyRowsFunc)
@@ -3006,6 +3012,13 @@ func (mgtr *Migrator) checkpointLoop() {
30063012
} else {
30073013
mgtr.migrationContext.Log.Errorf("error attempting checkpoint: %+v", err)
30083014
}
3015+
} else if mgtr.migrationContext.IsMoveTablesMode() {
3016+
// Move-tables writes one checkpoint row per table; the per-table range
3017+
// and iteration live in those rows (and the status output). The single
3018+
// run-wide summary line has no representative range, so report the
3019+
// aggregate progress instead of the (empty) single-table range fields.
3020+
mgtr.migrationContext.Log.Infof("checkpoint success at coords=%+v tables=%d rows_copied=%d dml_applied=%d",
3021+
chk.LastTrxCoords.DisplayString(), len(mgtr.migrationContext.MoveTables.TableNames), chk.RowsCopied, chk.DMLApplied)
30093022
} else {
30103023
mgtr.migrationContext.Log.Infof("checkpoint success at coords=%+v range_min=%+v range_max=%+v iteration=%d",
30113024
chk.LastTrxCoords.DisplayString(), chk.IterationRangeMin.String(), chk.IterationRangeMax.String(), chk.Iteration)

0 commit comments

Comments
 (0)