Skip to content

Commit

Permalink
Fix a couple of logs in VTOrc (vitessio#13667)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuptaManan100 authored Aug 1, 2023
1 parent 364209f commit 0a8e89e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion go/vt/vtorc/inst/instance_dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,9 @@ func ForgetLongUnseenInstances() error {
log.Error(err)
return err
}
_ = AuditOperation("forget-unseen", "", fmt.Sprintf("Forgotten instances: %d", rows))
if rows > 0 {
_ = AuditOperation("forget-unseen", "", fmt.Sprintf("Forgotten instances: %d", rows))
}
return err
}

Expand Down
2 changes: 2 additions & 0 deletions go/vt/vtorc/logic/topology_recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ func getCheckAndRecoverFunctionCode(analysisCode inst.AnalysisCode, tabletAlias
case inst.DeadPrimary, inst.DeadPrimaryAndSomeReplicas:
// If ERS is disabled, we have no way of repairing the cluster.
if !config.ERSEnabled() {
log.Infof("VTOrc not configured to run ERS, skipping recovering %v", analysisCode)
return noRecoveryFunc
}
if isInEmergencyOperationGracefulPeriod(tabletAlias) {
Expand All @@ -397,6 +398,7 @@ func getCheckAndRecoverFunctionCode(analysisCode inst.AnalysisCode, tabletAlias
case inst.PrimaryTabletDeleted:
// If ERS is disabled, we have no way of repairing the cluster.
if !config.ERSEnabled() {
log.Infof("VTOrc not configured to run ERS, skipping recovering %v", analysisCode)
return noRecoveryFunc
}
if isInEmergencyOperationGracefulPeriod(tabletAlias) {
Expand Down

0 comments on commit 0a8e89e

Please sign in to comment.