HeartbeatLag must be < than --max-lag-millis and --cut-over-lock-timeout-seconds to continue
This commit is contained in:
parent
503b7b0d6c
commit
3135a25c1f
@ -497,9 +497,10 @@ func (this *Migrator) cutOver() (err error) {
|
||||
this.sleepWhileTrue(
|
||||
func() (bool, error) {
|
||||
heartbeatLag := this.migrationContext.TimeSinceLastHeartbeatOnChangelog()
|
||||
maxLagMillisecondsThrottleThreshold := atomic.LoadInt64(&this.migrationContext.MaxLagMillisecondsThrottleThreshold)
|
||||
if heartbeatLag > time.Duration(maxLagMillisecondsThrottleThreshold)*time.Millisecond {
|
||||
this.migrationContext.Log.Debugf("current HeartbeatLag (%.2fs) is too high, it needs to be less than --max-lag-millis (%.2fs) to continue", heartbeatLag.Seconds(), (time.Duration(maxLagMillisecondsThrottleThreshold) * time.Millisecond).Seconds())
|
||||
maxLagMillisecondsThrottle := time.Duration(atomic.LoadInt64(&this.migrationContext.MaxLagMillisecondsThrottleThreshold)) * time.Millisecond
|
||||
cutOverLockTimeout := time.Duration(this.migrationContext.CutOverLockTimeoutSeconds) * time.Second
|
||||
if heartbeatLag > maxLagMillisecondsThrottle || heartbeatLag > cutOverLockTimeout {
|
||||
this.migrationContext.Log.Debugf("current HeartbeatLag (%.2fs) is too high, it needs to be less than both --max-lag-millis (%.2fs) and --cut-over-lock-timeout-seconds (%.2fs) to continue", heartbeatLag.Seconds(), maxLagMillisecondsThrottle.Seconds(), cutOverLockTimeout.Seconds())
|
||||
return true, nil
|
||||
}
|
||||
if this.migrationContext.PostponeCutOverFlagFile == "" {
|
||||
|
Loading…
Reference in New Issue
Block a user