Hello Kudu Jenkins,

I'd like you to reexamine a change.  Please visit


to look at the new patch set (#8).

Change subject: KUDU-798 (part 3) Make replica transactions start/abort on the 
consensus thread

KUDU-798 (part 3) Make replica transactions start/abort on the consensus thread

In order for a consensus replica to safely move "safe" time, it needs
to know that all transactions that come before it have at least
started. One way to do this is to call transaction_->Start() on
transaction_driver_->Init() which we know is called by the thread
updating consensus for non-leader transctions. This should be ok, as
the leader has already correctly serialized the transactions.

However, if transactions are now started on Init() then, in the case
they abort (i.e. when transaction_driver_->ReplicationFinished() is
called with a non-ok status, again done by the thread updating
consensus), we now must make sure that the transaction is actually
removed from mvcc before that method returns. Otherwise consensus
might call Start() on another transaction with the same timestamp
before the failed transaction is removed from mvcc.

To do this, this patch adds a latch to make sure that, if replication
failed, the prepare phase has completed before returning from

Finally this patch adds a couple of statements to increase the
driver's refcount so that it survives until the latch may be called.

Ran this in dist-test, slow mode, asan, 1000 times. No failures.

raft_consensus-itest     : 

Change-Id: Ie360e597eea86551c453717d7a1a000848027f4c
M src/kudu/tablet/transactions/transaction_driver.cc
M src/kudu/tablet/transactions/transaction_driver.h
2 files changed, 58 insertions(+), 26 deletions(-)

  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/94/5294/8
To view, visit http://gerrit.cloudera.org:8080/5294
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie360e597eea86551c453717d7a1a000848027f4c
Gerrit-PatchSet: 8
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: David Ribeiro Alves <dral...@apache.org>
Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <dral...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mpe...@apache.org>
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>

Reply via email to