From f197e2bacb77fd22b16433d6fd2ee56ac810572a Mon Sep 17 00:00:00 2001 From: Aayush Shah Date: Tue, 20 Sep 2022 15:59:54 -0400 Subject: [PATCH] kvserver: log retriable errors received during splits Informs #87837 Release note: None --- pkg/kv/kvserver/replica_command.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/kv/kvserver/replica_command.go b/pkg/kv/kvserver/replica_command.go index 5b65e682e968..294a26cc8158 100644 --- a/pkg/kv/kvserver/replica_command.go +++ b/pkg/kv/kvserver/replica_command.go @@ -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 @@ -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) }