diff --git a/internal/app/replication.go b/internal/app/replication.go index 69f1fe30..b7f6f32d 100644 --- a/internal/app/replication.go +++ b/internal/app/replication.go @@ -41,7 +41,7 @@ func (app *App) MarkReplicationRunning(node *mysql.Node, channel string) { newGtidSet := gtids.ParseGtidSet(status.GetExecutedGtidSet()) oldGtidSet := gtids.ParseGtidSet(replState.LastGTIDExecuted) - if !gtids.IsSlaveBehindOrEqual(newGtidSet, oldGtidSet) { + if gtids.IsSlaveAhead(newGtidSet, oldGtidSet) { delete(app.replRepairState, key) } } diff --git a/internal/app/util.go b/internal/app/util.go index b3b54548..6a2feca3 100644 --- a/internal/app/util.go +++ b/internal/app/util.go @@ -226,7 +226,8 @@ func isSlavePermanentlyLost(sstatus mysql.ReplicaStatus, masterGtidSet gtids.GTI return true } slaveGtidSet := gtids.ParseGtidSet(sstatus.GetExecutedGtidSet()) - return !gtids.IsSlaveBehindOrEqual(slaveGtidSet, masterGtidSet) + // TODO: why ahead = lost?.. + return gtids.IsSlaveAhead(slaveGtidSet, masterGtidSet) } func validatePriority(priority *int64) error {