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

Check and recover random order #800

Merged
merged 4 commits into from
Feb 10, 2019
Merged
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
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