Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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.
Jump to
Jump to file
Failed to load files.
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