From 4b67853619ed95852b2376ed8dfa2f975f8c1c02 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 9934d5458f88..50816bb6ba22 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.