diff --git a/internal/app/app.go b/internal/app/app.go index 66f29f17..42c742f5 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -869,7 +869,7 @@ func (app *App) calcActiveNodes(clusterState, clusterStateDcs map[string]*NodeSt continue } sgtids := gtids.ParseGtidSet(sstatus.ExecutedGtidSet) - if !(sstatus.ReplicationState == mysql.ReplicationRunning && isGTIDLessOrEqual(sgtids, mgtids)) { + if !(sstatus.ReplicationState == mysql.ReplicationRunning && isSplitBrained(sgtids, mgtids)) { app.logger.Errorf("calc active nodes: %s is not replicating or splitbrained, deleting from active...", host) continue } diff --git a/internal/app/util.go b/internal/app/util.go index 4cb79076..6a99038c 100644 --- a/internal/app/util.go +++ b/internal/app/util.go @@ -233,6 +233,10 @@ func isGTIDLessOrEqual(slaveGtidSet, masterGtidSet gtids.GTIDSet) bool { return masterGtidSet.Contain(slaveGtidSet) || masterGtidSet.Equal(slaveGtidSet) } +func isSplitBrained(firstGtidSet, secondGtidSet gtids.GTIDSet) bool { + return firstGtidSet.Contain(secondGtidSet) || secondGtidSet.Contain(firstGtidSet) || firstGtidSet.Equal(secondGtidSet) +} + func validatePriority(priority *int64) error { if priority == nil || *priority >= 0 { return nil