Skip to content

Commit

Permalink
fix waitForCatchUp return in async mode
Browse files Browse the repository at this point in the history
  • Loading branch information
suetin committed Mar 19, 2024
1 parent 3a4dcb0 commit 62a430a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -2128,6 +2128,7 @@ func (app *App) waitForCatchUp(node *mysql.Node, gtidset gtids.GTIDSet, timeout
return false, nil
}
if app.config.ASync && switchover.Cause == CauseAuto {
app.logger.Infof("async mode is active and this is auto switch so we checking new master delay")
ts, err := app.GetMdbReplMonTs()
if err != nil {
app.logger.Errorf("failed to get mdb repl mon ts: %v", err)
Expand All @@ -2139,9 +2140,9 @@ func (app *App) waitForCatchUp(node *mysql.Node, gtidset gtids.GTIDSet, timeout
continue
}
if delay < app.config.ASyncAllowedLag {
app.logger.Infof("async allowed lag is %s and current lag on host %s is %s, so we don't wait for catch up any more",
app.logger.Infof("async allowed lag is %d and current lag on host %s is %d, so we don't wait for catch up any more",
app.config.ASyncAllowedLag, node.Host(), delay)
break
return true, nil
}
}
time.Sleep(sleep)
Expand Down

0 comments on commit 62a430a

Please sign in to comment.