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

fix https://github.com/openark/orchestrator/issues/1430 #1471

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ main
.vendor/go19
/bin
/build
yangsq.md
6 changes: 4 additions & 2 deletions go/logic/topology_recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,8 @@ func checkAndRecoverDeadMaster(analysisEntry inst.ReplicationAnalysis, candidate
}
if config.Config.DelayMasterPromotionIfSQLThreadNotUpToDate && !promotedReplica.SQLThreadUpToDate() {
AuditTopologyRecovery(topologyRecovery, fmt.Sprintf("DelayMasterPromotionIfSQLThreadNotUpToDate: waiting for SQL thread on %+v", promotedReplica.Key))
if _, err := inst.WaitForSQLThreadUpToDate(&promotedReplica.Key, 0, 0); err != nil {
// At this time, SQL thread is close.when timeout/overallTimeout is equal 0(24 * time.Hour), SQL thread will start and apply complete binlog events
if _, err := inst.StopReplicationNicely(&promotedReplica.Key, 0); err != nil {
return nil, fmt.Errorf("DelayMasterPromotionIfSQLThreadNotUpToDate error: %+v", err)
}
AuditTopologyRecovery(topologyRecovery, fmt.Sprintf("DelayMasterPromotionIfSQLThreadNotUpToDate: SQL thread caught up on %+v", promotedReplica.Key))
Expand Down Expand Up @@ -1355,7 +1356,8 @@ func RecoverDeadCoMaster(topologyRecovery *TopologyRecovery, skipProcesses bool)
if promotedReplica != nil {
if config.Config.DelayMasterPromotionIfSQLThreadNotUpToDate {
AuditTopologyRecovery(topologyRecovery, fmt.Sprintf("Waiting to ensure the SQL thread catches up on %+v", promotedReplica.Key))
if _, err := inst.WaitForSQLThreadUpToDate(&promotedReplica.Key, 0, 0); err != nil {
// At this time, SQL thread is close.when timeout/overallTimeout is equal 0(24 * time.Hour), SQL thread will start and apply complete binlog events
if _, err := inst.StopReplicationNicely(&promotedReplica.Key, 0); err != nil {
return promotedReplica, lostReplicas, err
}
AuditTopologyRecovery(topologyRecovery, fmt.Sprintf("SQL thread caught up on %+v", promotedReplica.Key))
Expand Down