AuditTopologyRecovery(topologyRecovery,fmt.Sprintf("semi-sync: could not read replica instances for %+v: %s",analysisEntry.AnalyzedInstanceKey,err.Error()))
returntrue,topologyRecovery,err
returnfalse,topologyRecovery,err
}
iflen(replicas)==0{
AuditTopologyRecovery(topologyRecovery,fmt.Sprintf("semi-sync: no replicas found for %+v; cannot recover",analysisEntry.AnalyzedInstanceKey))
returnfalse,topologyRecovery,nil
}
// Classify and prioritize replicas & figure out which replicas need to be acted upon
AuditTopologyRecovery(topologyRecovery,fmt.Sprintf("semi-sync: not enough valid live replicas found to recover from %s on %+v.",analysisEntry.AnalysisString(),analysisEntry.AnalyzedInstanceKey))
returntrue,topologyRecovery,fmt.Errorf("not enough valid live replicas found to recover from %s on %+v",analysisEntry.AnalysisString(),analysisEntry.AnalyzedInstanceKey)
}elseiflen(actions)==0{
AuditTopologyRecovery(topologyRecovery,fmt.Sprintf("semi-sync: cannot determine actions based on possible semi-sync replicas; cannot recover from %s on %+v.",analysisEntry.AnalysisString(),analysisEntry.AnalyzedInstanceKey))
returntrue,topologyRecovery,fmt.Errorf("cannot determine actions based on possible semi-sync replicas; cannot recover from %s on %+v",analysisEntry.AnalysisString(),analysisEntry.AnalyzedInstanceKey)
}
// Take action: we first enable and then disable (two loops) in order to avoid "locked master" scenarios