Hello Alexey Serbin, Kudu Jenkins,

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

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

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

Change subject: KUDU-2612: allow ABORT_TXN txn ops to succeed if txn hasn't 
started
......................................................................

KUDU-2612: allow ABORT_TXN txn ops to succeed if txn hasn't started

This patch allows ABORT_TXN ops to proceed even if the participant
hasn't yet initialized the transaction. This is desirable in the case
where a participant has successfully registered with the
TxnStatusManager, but hasn't yet replicated its BEGIN_TXN op. In these
cases, the ops will unregister any pending TxnOpDispatchers, as well as
mark the existence of the transaction on the participant, preventing
further participant registrations for the transaction.

Take the following as an example:
1. a transactional write op is sent to a participant
2. the participant successfully registers with the TxnStatusManager
3. before the BEGIN_TXN op replicates, the node crashes
4. no further retry of the write is sent
5. the user attempt to commit the transaction
6. the BEGIN_COMMIT op fails because the transaction hasn't started on
   the participant
7. an ABORT_TXN op is scheduled but that fails too because the the
   transaction hasn't started on the participant

With this patch, step 7 should succeed, and successfully replicate the
ABORT_TXN op, even though the transaction doesn't exist. The test[1] for
this isn't enabled yet -- some additional plumbing is required to ensure
we return the correct error codes.

Along the way, I hardened up an edge case for BEGIN_COMMIT so
TXN_ILLEGAL_STATE is returned if the transaction doesn't exist, instead
of returning a plain IllegalState, which would have resulted in the
ParticipantRpc being retried.

[1] see TxnOpDispatcherITest.CommitWithWriteOpPendingParticipantRegistered

Change-Id: Ia4c864b4f14e42008d3aa8f4454c8b2abf9bb766
---
M src/kudu/integration-tests/txn_participant-itest.cc
M src/kudu/tablet/tablet.cc
M src/kudu/tablet/tablet_metadata.cc
M src/kudu/tablet/txn_metadata.h
M src/kudu/tablet/txn_participant-test.cc
M src/kudu/tablet/txn_participant.h
6 files changed, 119 insertions(+), 54 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/33/17233/5
--
To view, visit http://gerrit.cloudera.org:8080/17233
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia4c864b4f14e42008d3aa8f4454c8b2abf9bb766
Gerrit-Change-Number: 17233
Gerrit-PatchSet: 5
Gerrit-Owner: Andrew Wong <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Andrew Wong <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)

Reply via email to