Andrew Wong has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/16831 )

Change subject: txn_participant: return TXN_ILLEGAL_STATE code on illegal state 
errors
......................................................................

txn_participant: return TXN_ILLEGAL_STATE code on illegal state errors

I have a patch coming up that sends RPCs that submit participant ops to
the TxnParticipant and retries if necessary. One of the criteria to
retry an RPC is checking if the Raft application returned an
IllegalState error, e.g. in RaftConsensus::CheckLeadershipAndBindTerm.

This is problematic, as TxnParticipants may also return IllegalState if
the transaction is not in an appropriate state (e.g. an RPC tries to
abort an already-committed transaction). To disambiguate such cases,
this patch updates the TxnParticipants to also set a TabletServerErrorPB
code when such an error occurs, allowing for more specific error
handling to be determined.

Change-Id: Ibfb8400666855c694b78b1425b1c121597ec7ccf
Reviewed-on: http://gerrit.cloudera.org:8080/16831
Reviewed-by: Alexey Serbin <[email protected]>
Tested-by: Andrew Wong <[email protected]>
---
M src/kudu/integration-tests/txn_participant-itest.cc
M src/kudu/tablet/ops/participant_op.cc
M src/kudu/tablet/ops/participant_op.h
M src/kudu/tablet/txn_participant-test.cc
M src/kudu/tablet/txn_participant.h
5 files changed, 159 insertions(+), 88 deletions(-)

Approvals:
  Alexey Serbin: Looks good to me, approved
  Andrew Wong: Verified

--
To view, visit http://gerrit.cloudera.org:8080/16831
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibfb8400666855c694b78b1425b1c121597ec7ccf
Gerrit-Change-Number: 16831
Gerrit-PatchSet: 4
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