Skip to content

Commit

Permalink
Merge #26238
Browse files Browse the repository at this point in the history
26238: storage: avoid querying pusher where transaction record can't exist r=spencerkimball a=spencerkimball

This change checks whether a txn has a non-nil key before querying it
if it's waiting on an extant transaction which owns a conflicting intent.
Previously, the code would query the pusher's txn, even if the key was
nil, which would just send a spurious `QueryTxn` request to the first
range in the keyspace.

See #26059

Release note: None

Co-authored-by: Spencer Kimball <[email protected]>
  • Loading branch information
craig[bot] and spencerkimball committed May 30, 2018
2 parents 1033a39 + c76ef9e commit 0f9fafe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/storage/txnwait/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ func (q *Queue) MaybeWaitForPush(
var queryPusherCh <-chan *roachpb.Transaction // accepts updates to the pusher txn
var queryPusherErrCh <-chan *roachpb.Error // accepts errors querying the pusher txn
var readyCh chan struct{} // signaled when pusher txn should be queried
if req.PusherTxn.ID != (uuid.UUID{}) {
if req.PusherTxn.ID != uuid.Nil && req.PusherTxn.Key != nil {
// Create a context which will be canceled once this call completes.
// This ensures that the goroutine created to query the pusher txn
// is properly cleaned up.
Expand Down

0 comments on commit 0f9fafe

Please sign in to comment.