From bd0733d9a1e552defd8deb62f97f99993bae7073 Mon Sep 17 00:00:00 2001 From: Andrei Matei Date: Tue, 16 Jun 2020 15:18:41 -0400 Subject: [PATCH] kvserver: minor logging improvements to refreshes Release note: None --- .../kvclient/kvcoord/txn_interceptor_span_refresher.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/kv/kvclient/kvcoord/txn_interceptor_span_refresher.go b/pkg/kv/kvclient/kvcoord/txn_interceptor_span_refresher.go index 5eac2c10c992..072b93280da9 100644 --- a/pkg/kv/kvclient/kvcoord/txn_interceptor_span_refresher.go +++ b/pkg/kv/kvclient/kvcoord/txn_interceptor_span_refresher.go @@ -285,8 +285,12 @@ func (sr *txnSpanRefresher) sendLockedWithRefreshAttempts( bumpedTxn) br = nil } - if pErr != nil && maxRefreshAttempts > 0 { - br, pErr = sr.maybeRetrySend(ctx, ba, pErr, maxRefreshAttempts) + if pErr != nil { + if maxRefreshAttempts > 0 { + br, pErr = sr.maybeRetrySend(ctx, ba, pErr, maxRefreshAttempts) + } else { + log.VEventf(ctx, 2, "not checking error for refresh; refresh attempts exhausted") + } } sr.forwardRefreshTimestampOnResponse(br, pErr) return br, pErr @@ -323,6 +327,7 @@ func (sr *txnSpanRefresher) maybeRetrySend( return nil, pErr } sr.refreshSuccess.Inc(1) + log.Eventf(ctx, "refresh succeeded; retrying original request") // We've refreshed all of the read spans successfully and bumped // ba.Txn's timestamps. Attempt the request again.