Skip to content

Commit

Permalink
kvserver: minor logging improvements to refreshes
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
andreimatei committed Jun 18, 2020
1 parent 784f438 commit bd0733d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/kv/kvclient/kvcoord/txn_interceptor_span_refresher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit bd0733d

Please sign in to comment.