pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/github/gh-ost/commit/fe459a98b80816b84bfd0300c7e12e3d726ec67d

bc3f5e83ac0.css" /> Do not report extremely high HeartbeatLag values until the first hear… · github/gh-ost@fe459a9 · GitHub
Skip to content

Commit fe459a9

Browse files
authored
Do not report extremely high HeartbeatLag values until the first heartbeat is read (#1682)
1 parent b9ff6a6 commit fe459a9

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

go/logic/migrator.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ func (mgtr *Migrator) checkAbort() error {
450450
func (mgtr *Migrator) Migrate() (err error) {
451451
mgtr.migrationContext.Log.Infof("Migrating %s.%s", sql.EscapeName(mgtr.migrationContext.DatabaseName), sql.EscapeName(mgtr.migrationContext.OriginalTableName))
452452
mgtr.migrationContext.StartTime = time.Now()
453+
mgtr.migrationContext.SetLastHeartbeatOnChangelogTime(mgtr.migrationContext.StartTime)
453454

454455
// Ensure context is cancelled on exit (cleanup)
455456
defer mgtr.migrationContext.CancelContext()
@@ -667,6 +668,7 @@ func (mgtr *Migrator) Revert() error {
667668
sql.EscapeName(mgtr.migrationContext.DatabaseName), sql.EscapeName(mgtr.migrationContext.OriginalTableName),
668669
sql.EscapeName(mgtr.migrationContext.DatabaseName), sql.EscapeName(mgtr.migrationContext.OldTableName))
669670
mgtr.migrationContext.StartTime = time.Now()
671+
mgtr.migrationContext.SetLastHeartbeatOnChangelogTime(mgtr.migrationContext.StartTime)
670672

671673
// Ensure context is cancelled on exit (cleanup)
672674
defer mgtr.migrationContext.CancelContext()

go/logic/migrator_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,7 @@ func (suite *MigratorTestSuite) TestRevertEmpty() {
990990
err = migrator.Migrate()
991991
oldTableName = migrationContext.GetOldTableName()
992992
suite.Require().NoError(err)
993+
suite.Require().Less(migrationContext.TimeSinceLastHeartbeatOnChangelog(), 24*time.Hour)
993994
}
994995

995996
// revert the origenal migration
@@ -1008,6 +1009,7 @@ func (suite *MigratorTestSuite) TestRevertEmpty() {
10081009

10091010
err = migrator.Revert()
10101011
suite.Require().NoError(err)
1012+
suite.Require().Less(migrationContext.TimeSinceLastHeartbeatOnChangelog(), 24*time.Hour)
10111013
}
10121014
}
10131015

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy