Skip to content

Commit

Permalink
Merge pull request #800 from github/check-and-recover-random-order
Browse files Browse the repository at this point in the history
Check and recover random order
  • Loading branch information
Shlomi Noach committed Feb 10, 2019
2 parents 03b6a6d + a93dd41 commit dda3a33
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go/inst/instance_dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ func readInstanceRow(m sqlutils.RowMap) *Instance {
instance.Problems = append(instance.Problems, "not_recently_checked")
} else if instance.ReplicationThreadsExist() && !instance.ReplicaRunning() {
instance.Problems = append(instance.Problems, "not_replicating")
} else if instance.SlaveLagSeconds.Valid && instance.SlaveLagSeconds.Int64 > int64(config.Config.ReasonableReplicationLagSeconds) {
} else if instance.SlaveLagSeconds.Valid && math.AbsInt64(instance.SlaveLagSeconds.Int64-int64(instance.SQLDelay)) > int64(config.Config.ReasonableReplicationLagSeconds) {
instance.Problems = append(instance.Problems, "replication_lag")
}
if instance.GtidErrant != "" {
Expand Down
4 changes: 2 additions & 2 deletions go/logic/topology_recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -1604,8 +1604,8 @@ func CheckAndRecover(specificInstance *inst.InstanceKey, candidateInstanceKey *i
skipProcesses = true
}
// intentionally iterating entries in random order
for i := range rand.Perm(len(replicationAnalysis)) {
analysisEntry := replicationAnalysis[i]
for _, j := range rand.Perm(len(replicationAnalysis)) {
analysisEntry := replicationAnalysis[j]
if specificInstance != nil {
// We are looking for a specific instance; if this is not the one, skip!
if !specificInstance.Equals(&analysisEntry.AnalyzedInstanceKey) {
Expand Down
6 changes: 1 addition & 5 deletions resources/public/js/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -1386,11 +1386,7 @@ function Cluster() {
content = '<hr/>' + content
}
wrappedContent = '<div data-tag="'+tag+'">' + content + '<div style="clear: both;"></div></div>';
if (tag === "analysis") {
$("#cluster_info").append(wrappedContent)
} else {
$("#cluster_info").append(wrappedContent)
}
$("#cluster_info").append(wrappedContent)
}

function populateSidebar(clusterInfo) {
Expand Down

0 comments on commit dda3a33

Please sign in to comment.