David Ribeiro Alves has uploaded a new change for review.

  http://gerrit.cloudera.org:8080/5294

Change subject: WIP: Make sure replica transactions start/abort on the 
consensus thread
......................................................................

WIP: Make sure replica transactions start/abort on the consensus thread

In order for a 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 consensus
thread. 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 on the consensus thread) we
now must make sure that the transaction is actually removed from
mvcc in-line. Otherwise the consensus thread might call Start() on
another transaction with the same timestamp before the failed
transaction is removed from mvcc.

To do this, this patch add a latch to make sure that, if replication
failed, the prepare phase has completed.

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


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie360e597eea86551c453717d7a1a000848027f4c
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: David Ribeiro Alves <dral...@apache.org>

Reply via email to