Skip to content

Set drain-gtid when resuming in move-tables mode#1720

Merged
danieljoos merged 1 commit into
feature-move-tablesfrom
danieljoos-move-tables-resume-gtid
Jun 22, 2026
Merged

Set drain-gtid when resuming in move-tables mode#1720
danieljoos merged 1 commit into
feature-move-tablesfrom
danieljoos-move-tables-resume-gtid

Conversation

@danieljoos

Copy link
Copy Markdown
Contributor

A Pull Request should be associated with an Issue.

We wish to have discussions in Issues. A single issue may be targeted by multiple PRs.
If you're offering a new feature or fixing anything, we'd like to know beforehand in Issues,
and potentially we'll be able to point development in a particular direction.

Related issue: #1681
Related issue (internal): https://github.com/github/database-infrastructure/issues/8261

Further notes in https://github.com/github/gh-ost/blob/master/.github/CONTRIBUTING.md
Thank you! We are open to PRs, but please understand if for technical reasons we are unable to accept each and any PR

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.

In case this PR introduced Go code changes:

  • contributed code is using same conventions as original code
  • script/cibuild returns with no formatting errors, build errors or unit test errors.

Copilot AI review requested due to automatic review settings June 22, 2026 13:13
@danieljoos danieljoos added the feature-move-tables PRs that are associated with the new move-tables feature label Jun 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.DrainGTID from the move-tables cutover checkpoint during resume.
  • Ensure the resumed OnSuccess hook 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 thread go/logic/migrator.go
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 {
@danieljoos danieljoos merged commit fe3e20e into feature-move-tables Jun 22, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature-move-tables PRs that are associated with the new move-tables feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants