Skip to content

Commit

Permalink
kvcoord: (partially) de-flake tpcc/multiregion
Browse files Browse the repository at this point in the history
Touches cockroachdb#85711, fixing one of the failure modes. In cockroachdb#85101 we deleted
code in the span refresher interceptor that WriteTooOld flags. We did so
assuming these flags were only set in 19.2 servers, but that's not the
case. Since we were no longer terminating the flag, in rare occasions we
hit an assertion that this flag was not set on batch requests. Removing
this termination code made this possible, see
85711#issuecomment-1240064777 for more details.

Release note: None
  • Loading branch information
irfansharif committed Sep 9, 2022
1 parent af5f687 commit 91d95f2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/kv/kvclient/kvcoord/txn_interceptor_span_refresher.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,13 @@ func (sr *txnSpanRefresher) sendLockedWithRefreshAttempts(
}
br, pErr := sr.wrapped.SendLocked(ctx, ba)

// We might receive errors with the WriteTooOld flag set. This interceptor
// wants to always terminate that flag. In the case of an error, we can just
// ignore it.
if pErr != nil && pErr.GetTxn() != nil {
pErr.GetTxn().WriteTooOld = false
}

if pErr == nil && br.Txn.WriteTooOld {
// If we got a response with the WriteTooOld flag set, then we pretend that
// we got a WriteTooOldError, which will cause us to attempt to refresh and
Expand Down

0 comments on commit 91d95f2

Please sign in to comment.