From eb0f9e11a8dbfe7839e3ea4435dacf3cc6fa189e Mon Sep 17 00:00:00 2001 From: Aleksandr Shevchuk Date: Wed, 26 Jun 2024 23:23:17 +0300 Subject: [PATCH] fix isSlavePermanentlyLost --- internal/app/replication.go | 2 +- internal/app/util.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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 {