Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions go/logic/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ func (this *Migrator) createFlagFiles() (err error) {
func (this *Migrator) Migrate() (err error) {
this.migrationContext.Log.Infof("Migrating %s.%s", sql.EscapeName(this.migrationContext.DatabaseName), sql.EscapeName(this.migrationContext.OriginalTableName))
this.migrationContext.StartTime = time.Now()
this.migrationContext.SetLastHeartbeatOnChangelogTime(this.migrationContext.StartTime)
Copy link
Copy Markdown

@coding-chimp coding-chimp Feb 6, 2026

Choose a reason for hiding this comment

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

I don't see something similar for the replication lag. The 0.0 from your example seems impossibly low, do you know where that value comes from?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think it's also uninitialized, but as a numeric value. I'll see if we can just copy the fix and initialize it.

if this.migrationContext.Hostname, err = os.Hostname(); err != nil {
return err
}
Expand Down Expand Up @@ -588,6 +589,7 @@ func (this *Migrator) Revert() error {
sql.EscapeName(this.migrationContext.DatabaseName), sql.EscapeName(this.migrationContext.OriginalTableName),
sql.EscapeName(this.migrationContext.DatabaseName), sql.EscapeName(this.migrationContext.OldTableName))
this.migrationContext.StartTime = time.Now()
this.migrationContext.SetLastHeartbeatOnChangelogTime(this.migrationContext.StartTime)
var err error
if this.migrationContext.Hostname, err = os.Hostname(); err != nil {
return err
Expand Down
2 changes: 2 additions & 0 deletions go/logic/migrator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,7 @@ func (suite *MigratorTestSuite) TestRevertEmpty() {
err = migrator.Migrate()
oldTableName = migrationContext.GetOldTableName()
suite.Require().NoError(err)
suite.Require().Less(migrationContext.TimeSinceLastHeartbeatOnChangelog(), 24*time.Hour)
}

// revert the original migration
Expand All @@ -835,6 +836,7 @@ func (suite *MigratorTestSuite) TestRevertEmpty() {

err = migrator.Revert()
suite.Require().NoError(err)
suite.Require().Less(migrationContext.TimeSinceLastHeartbeatOnChangelog(), 24*time.Hour)
}
}

Expand Down
Loading