Andrew Wong has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/17159 )
Change subject: KUDU-2612: acquire and release partition lock ...................................................................... KUDU-2612: acquire and release partition lock This patch plumbs partition locks into write ops for transactional and non-transactional operations. Upon attempting to write, we try to acquire the partition lock in the WriteOp prepare phase, and upon successfully applying the op, we transfer ownership of the lock to the Txn that the write was a part of (or just release the partition lock if the write was non-transactional). Txns release the lock when FINALIZE_COMMIT or ABORT_TXN is applied. We take the partition lock for non-transactional write ops as well to ensure we don’t duplicate keys (e.g. if a transaction inserts key=1 and then a non-transactional write inserts key=1 before the transaction commits). If the partition lock cannot be acquired, the write op is aborted or retried, based on the wait-die mechanics already in the lock manager. A flag is also introduced to disable this locking for tests that currently expect support for concurrent transactions. Change-Id: If26733cae16810f3b3afd1fd05dcb984e6366939 Reviewed-on: http://gerrit.cloudera.org:8080/17159 Tested-by: Andrew Wong <aw...@cloudera.com> Reviewed-by: Alexey Serbin <aser...@cloudera.com> --- M src/kudu/client/batcher.cc M src/kudu/integration-tests/fuzz-itest.cc M src/kudu/integration-tests/txn_commit-itest.cc M src/kudu/integration-tests/txn_participant-itest.cc M src/kudu/integration-tests/txn_write_ops-itest.cc M src/kudu/tablet/lock_manager.h M src/kudu/tablet/ops/participant_op.cc M src/kudu/tablet/ops/write_op.cc M src/kudu/tablet/ops/write_op.h M src/kudu/tablet/tablet.cc M src/kudu/tablet/tablet.h M src/kudu/tablet/tablet_bootstrap.cc M src/kudu/tablet/txn_participant-test.cc M src/kudu/tablet/txn_participant.cc M src/kudu/tablet/txn_participant.h M src/kudu/transactions/participant_rpc.cc 16 files changed, 600 insertions(+), 16 deletions(-) Approvals: Andrew Wong: Verified Alexey Serbin: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/17159 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If26733cae16810f3b3afd1fd05dcb984e6366939 Gerrit-Change-Number: 17159 Gerrit-PatchSet: 12 Gerrit-Owner: Hao Hao <hao....@cloudera.com> Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com> Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com> Gerrit-Reviewer: Hao Hao <hao....@cloudera.com> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Tidy Bot (241)