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

Only Run SendSlackMessage From Primary VTorc Instances #597

Open
wants to merge 3 commits into
base: slack-19.0
Choose a base branch
from
Open
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
8 changes: 6 additions & 2 deletions go/vt/vtorc/logic/topology_recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -743,13 +743,17 @@ func executeCheckAndRecoverFunction(analysisEntry *inst.ReplicationAnalysis) (er
recoveriesCounter.Add(recoveryName, 1)
if err != nil {
message := fmt.Sprintf("Recovery failed on %s for problem %s. Error: %s", analysisEntry.AnalyzedInstanceHostname, analysisEntry.Analysis, err.Error())
vtopsExec.SendSlackMessage(message, vtopsSlackChannel)
if analysisEntry.IsPrimary {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IsPrimary is an attribute of the vtorc analysis (i.e. diagnostic of the problem), not of the vtorc instance itself. So with this change, the recovery messages would only be used for primary vttablets, bout would still be sent by all vtorcs. Unlike classical Orchestrator, in vtorc there are no cluster leaders/primaries, they all operate independently of each other.

vtopsExec.SendSlackMessage(message, vtopsSlackChannel)
}
logger.Errorf(message)
recoveriesFailureCounter.Add(recoveryName, 1)
} else {
message := fmt.Sprintf("Recovery succeeded on %s for problem %s.", analysisEntry.AnalyzedInstanceHostname, analysisEntry.Analysis)
logger.Info(message)
vtopsExec.SendSlackMessage(message, vtopsSlackChannel)
if analysisEntry.IsPrimary {
vtopsExec.SendSlackMessage(message, vtopsSlackChannel)
}
recoveriesSuccessfulCounter.Add(recoveryName, 1)
}
if topologyRecovery == nil {
Expand Down
Loading