From c76ef9e25d06f5b7180beb9e5dfa0613cbb51ead Mon Sep 17 00:00:00 2001 From: Spencer Kimball Date: Wed, 30 May 2018 12:26:42 -0400 Subject: [PATCH] storage: avoid querying pusher where transaction record can't exist 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 --- pkg/storage/txnwait/queue.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/storage/txnwait/queue.go b/pkg/storage/txnwait/queue.go index 12147064bdac..4edda5e5cf95 100644 --- a/pkg/storage/txnwait/queue.go +++ b/pkg/storage/txnwait/queue.go @@ -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.