Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

check FailMasterPromotionIfSQLThreadNotUpToDate in checkAndRecoverDeadCoMaster #535

Merged
merged 1 commit into from
Jun 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions go/logic/topology_recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,10 @@ func checkAndRecoverDeadCoMaster(analysisEntry inst.ReplicationAnalysis, candida
}
topologyRecovery.LostReplicas.AddInstances(lostReplicas)
if promotedReplica != nil {
if config.Config.FailMasterPromotionIfSQLThreadNotUpToDate && !promotedReplica.SQLThreadUpToDate() {
return false, nil, log.Errorf("Promoted replica %+v: sql thread is not up to date (relay logs still unapplied). Aborting promotion", promotedReplica.Key)
}

// success
recoverDeadCoMasterSuccessCounter.Inc(1)

Expand Down