Skip to content

Commit

Permalink
kvserver: log retriable errors received during splits
Browse files Browse the repository at this point in the history
Informs #87837

Release note: None
  • Loading branch information
aayushshah15 committed Sep 20, 2022
1 parent 7d06d8d commit f197e2b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/kv/kvserver/replica_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ func (r *Replica) executeAdminCommandWithDescriptor(
// that suggested this.
retryOpts.RandomizationFactor = 0.5
var lastErr error
splitRetryLogLimiter := log.Every(10 * time.Second)
for retryable := retry.StartWithCtx(ctx, retryOpts); retryable.Next(); {
// The replica may have been destroyed since the start of the retry loop.
// We need to explicitly check this condition. Having a valid lease, as we
Expand Down Expand Up @@ -549,6 +550,9 @@ func (r *Replica) executeAdminCommandWithDescriptor(
!errors.HasType(lastErr, (*roachpb.AmbiguousResultError)(nil)) {
break
}
if splitRetryLogLimiter.ShouldLog() {
log.Warningf(ctx, "retrying split after err: %v", lastErr)
}
}
return roachpb.NewError(lastErr)
}
Expand Down

0 comments on commit f197e2b

Please sign in to comment.