Skip to content

Commit

Permalink
storage: avoid querying pusher where transaction record can't exist
Browse files Browse the repository at this point in the history
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.

Release note: None
  • Loading branch information
spencerkimball committed May 30, 2018
1 parent f8a7889 commit c76ef9e
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 c76ef9e

Please sign in to comment.