Skip to content

Commit

Permalink
add temp conditional for vtops-vtorc
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <[email protected]>
  • Loading branch information
timvaillancourt committed Dec 18, 2024
1 parent 5211f61 commit 42e57a7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions go/vt/vtorc/logic/topology_recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"fmt"
"math/rand"
"os"
"strings"
"time"

"github.com/patrickmn/go-cache"
Expand Down Expand Up @@ -85,8 +86,9 @@ var (
recoveriesFailureCounter = stats.NewCountersWithSingleLabel("FailedRecoveries", "Count of the different failed recoveries performed", "RecoveryType", actionableRecoveriesNames...)

// vtops
vtopsPath = os.Getenv("VTOPS_PATH")
vtopsService = fmt.Sprintf("vtorc-%s-%s", os.Getenv("POOL"), os.Getenv("VITESS_ENVIRONMENT"))
vtopsExec = external.NewExecVTOps(os.Getenv("VTOPS_PATH"), vtopsService)
vtopsExec = external.NewExecVTOps(vtopsPath, vtopsService)
vtopsSlackChannel = os.Getenv("SLACK_CHANNEL")
)

Expand Down Expand Up @@ -304,7 +306,13 @@ func postErsCompletion(topologyRecovery *TopologyRecovery, analysisEntry *inst.R
_ = AuditTopologyRecovery(topologyRecovery, message)
_ = inst.AuditOperation(recoveryName, analysisEntry.AnalyzedInstanceAlias, message)
_ = AuditTopologyRecovery(topologyRecovery, fmt.Sprintf("%v: successfully promoted %+v", recoveryName, promotedReplica.InstanceAlias))
vtopsExec.RaiseProblem(analysisEntry.AnalyzedInstanceHostname, "orc-dead-tablet")

// TODO: remove this conditional and 'else' side after vtops-vtorc is used 100%.
if strings.HasSuffix(vtopsPath, "vtops-vtorc") {
vtopsExec.RaiseProblem(analysisEntry.AnalyzedInstanceAlias, "orc-dead-tablet")
} else {
vtopsExec.RaiseProblem(analysisEntry.AnalyzedInstanceHostname, "orc-dead-tablet")
}
}
}

Expand Down

0 comments on commit 42e57a7

Please sign in to comment.