Repository: kudu Updated Branches: refs/heads/master 5a46e6076 -> b333a36f1
TODO cleanup in TransactionManager This removes a couple of TODOs that were now wrong because we now have exactly-once retry semantics. The first was about not having to perform the actual waiting for commit wait on followers. With the new retry semantics this could easily mean that upon retrying a request on a follower a client would observe the result of the operation before it safe to do so. The second was about not peforming the waiting for commit wait if the RPCs deadline was expired. A client can now have a total deadline that is higher than a specific RPC's deadline and has exactly once semantics meaning even if the specific RPC's deadline is expired the client might still retry within the context of the global deadline. In that case we wouldn't want to have the client observe the operation before it was supposed to. Change-Id: Ib41a5a65dee29d26f0e7c72b4f2d30f1267c8cf2 Reviewed-on: http://gerrit.cloudera.org:8080/4826 Tested-by: Kudu Jenkins Reviewed-by: Todd Lipcon <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/f2a39c62 Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/f2a39c62 Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/f2a39c62 Branch: refs/heads/master Commit: f2a39c624abcd605d64d6301c3d5e307557c4127 Parents: 5a46e60 Author: David Alves <[email protected]> Authored: Wed Oct 12 16:15:02 2016 -0700 Committer: David Ribeiro Alves <[email protected]> Committed: Wed Oct 26 02:32:40 2016 +0000 ---------------------------------------------------------------------- src/kudu/tablet/transactions/transaction_driver.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/f2a39c62/src/kudu/tablet/transactions/transaction_driver.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/transactions/transaction_driver.cc b/src/kudu/tablet/transactions/transaction_driver.cc index 60af908..3a10c16 100644 --- a/src/kudu/tablet/transactions/transaction_driver.cc +++ b/src/kudu/tablet/transactions/transaction_driver.cc @@ -479,7 +479,6 @@ void TransactionDriver::ApplyTask() { // until now.earliest > prepare_latest. Only after this are the locks // released. if (mutable_state()->external_consistency_mode() == COMMIT_WAIT) { - // TODO: only do this on the leader side TRACE("APPLY: Commit Wait."); // If we can't commit wait and have already applied we might have consistency // issues if we still reply to the client that the operation was a success. @@ -505,11 +504,8 @@ void TransactionDriver::SetResponseTimestamp(TransactionState* transaction_state Status TransactionDriver::CommitWait() { MonoTime before = MonoTime::Now(); DCHECK(mutable_state()->external_consistency_mode() == COMMIT_WAIT); - // TODO: we could plumb the RPC deadline in here, and not bother commit-waiting - // if the deadline is already expired. - RETURN_NOT_OK( - mutable_state()->tablet_peer()->clock()->WaitUntilAfter(mutable_state()->timestamp(), - MonoTime::Max())); + RETURN_NOT_OK(mutable_state()->tablet_peer()->clock()->WaitUntilAfter( + mutable_state()->timestamp(), MonoTime::Max())); mutable_state()->mutable_metrics()->commit_wait_duration_usec = (MonoTime::Now() - before).ToMicroseconds(); return Status::OK();
