Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kvcoord: remove an artifact of unsetting WriteTooOld flag #85101

Merged
merged 1 commit into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions pkg/kv/kvclient/kvcoord/txn_coord_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,6 @@ func newLeafTxnCoordSender(
tcf *TxnCoordSenderFactory, tis *roachpb.LeafTxnInputState,
) kv.TxnSender {
txn := &tis.Txn
// 19.2 roots might have this flag set. In 20.1, the flag is only set by the
// server and terminated by the client in the span refresher interceptor. If
// the root is a 19.2 node, we reset the flag because it only confuses
// that interceptor and provides no benefit.
txn.WriteTooOld = false
txn.AssertInitialized(context.TODO())

if txn.Status != roachpb.PENDING {
Expand Down
7 changes: 0 additions & 7 deletions pkg/kv/kvclient/kvcoord/txn_interceptor_span_refresher.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,6 @@ func (sr *txnSpanRefresher) sendLockedWithRefreshAttempts(
}
br, pErr := sr.wrapped.SendLocked(ctx, ba)

// 19.2 servers might give us an error 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