Skip to content

Commit

Permalink
Merge pull request #1264 from openark/mariadb-gtid-io-thread
Browse files Browse the repository at this point in the history
Skip RestartReplicationQuick() on MariaDB with GTID
  • Loading branch information
shlomi-noach committed Nov 19, 2020
2 parents e305ad0 + 4b95079 commit f17c442
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions go/logic/topology_recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,23 @@ func emergentlyRestartReplicationOnTopologyInstance(instanceKey *inst.InstanceKe
// Just recently attempted on this specific replica
return
}

go inst.ExecuteOnTopology(func() {
instance, _, err := inst.ReadInstance(instanceKey)
if err != nil {
return
}
if instance.UsingMariaDBGTID {
// In MariaDB GTID, stopping and starting IO thread actually deletes relay logs.
// This is counter productive to our objective.
// Specifically, in a situation where the primary is unreachable and where replicas are lagging,
// we want to restart IO thread to see if lag is actually caused by locked primary. If this results
// with losing relay logs, then we've lost data.
// So, unfortunately we avoid this step in MariaDB GTID.
// See https://github.com/openark/orchestrator/issues/1260
return
}

inst.RestartReplicationQuick(instanceKey)
inst.AuditOperation("emergently-restart-replication-topology-instance", instanceKey, string(analysisCode))
})
Expand Down

0 comments on commit f17c442

Please sign in to comment.