Set drain-gtid when resuming in move-tables mode#1720
Merged
danieljoos merged 1 commit intoJun 22, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ensures that when gh-ost resumes a move-tables cutover from a persisted checkpoint, it restores the cutover drain GTID into the migration context so the on-success hook can receive it (via GH_OST_DRAIN_GTID) just like in the non-resume path.
Changes:
- Populate
migrationContext.MoveTables.DrainGTIDfrom the move-tables cutover checkpoint during resume. - Ensure the resumed
OnSuccesshook execution has access to the drain GTID through the existing hooks environment mechanism.
Show a summary per file
| File | Description |
|---|---|
| go/logic/migrator.go | Sets MoveTables.DrainGTID from checkpoint during cutover resume so hooks can export GH_OST_DRAIN_GTID. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 1
Comment on lines
981
to
984
| atomic.StoreInt64(&mgtr.migrationContext.CutOverCompleteFlag, 1) | ||
| mgtr.migrationContext.Log.Debugf("T4: CutOverCompleteFlag set") | ||
| mgtr.migrationContext.MoveTables.DrainGTID = chk.MoveTablesCutOverDrainGTID | ||
| if err := mgtr.hooksExecutor.OnSuccess(false); err != nil { |
zacharysierakowski
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A Pull Request should be associated with an Issue.
Related issue: #1681
Related issue (internal): https://github.com/github/database-infrastructure/issues/8261
Description
This PR sets the drain-GTID when resuming gh-ost in move-tables mode.
The value is forwarded to the gh-ost hook scripts.
script/cibuildreturns with no formatting errors, build errors or unit test errors.