Fix rootcoord too frequent useless log (#20044)

Signed-off-by: longjiquan <jiquan.long@zilliz.com>

Signed-off-by: longjiquan <jiquan.long@zilliz.com>
pull/19893/head
Jiquan Long 2022-10-25 14:19:30 +08:00 committed by GitHub
parent 377cd210c2
commit 290b902ab0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -31,13 +31,19 @@ func (s *stepStack) Execute(ctx context.Context) *stepStack {
l := len(steps)
todo := steps[l-1]
childSteps, err := todo.Execute(ctx)
// TODO: maybe a interface `step.LogOnError` is better.
_, skipLog := todo.(*waitForTsSyncedStep)
if retry.IsUnRecoverable(err) {
log.Warn("failed to execute step, not able to reschedule", zap.Error(err), zap.String("step", todo.Desc()))
if !skipLog {
log.Warn("failed to execute step, not able to reschedule", zap.Error(err), zap.String("step", todo.Desc()))
}
return nil
}
if err != nil {
s.steps = nil // let s can be collected.
log.Warn("failed to execute step, wait for reschedule", zap.Error(err), zap.String("step", todo.Desc()))
if !skipLog {
log.Warn("failed to execute step, wait for reschedule", zap.Error(err), zap.String("step", todo.Desc()))
}
return &stepStack{steps: steps}
}
// this step is done.