You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by jg...@apache.org on 2017/06/10 00:08:39 UTC

kafka git commit: KAFKA-5415; Remove timestamp check in completeTransitionTo

Repository: kafka
Updated Branches:
  refs/heads/trunk 8e7839f61 -> 1e03b7118


KAFKA-5415; Remove timestamp check in completeTransitionTo

This assertion is hard to get right because the system time can roll backward on a host due to NTP (as shown in the ticket), and also because a transaction can start on one host and complete on another. Getting precise clock times across hosts is virtually impossible, and this check makes things fragile.

Author: Apurva Mehta <ap...@confluent.io>

Reviewers: Guozhang Wang <wa...@gmail.com>, Jason Gustafson <ja...@confluent.io>

Closes #3286 from apurvam/KAFKA-5415-avoid-timestamp-check-in-completeTransition


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/1e03b711
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/1e03b711
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/1e03b711

Branch: refs/heads/trunk
Commit: 1e03b711875d45081c6f839962f9a019d3f64d8c
Parents: 8e7839f
Author: Apurva Mehta <ap...@confluent.io>
Authored: Fri Jun 9 17:08:34 2017 -0700
Committer: Jason Gustafson <ja...@confluent.io>
Committed: Fri Jun 9 17:08:34 2017 -0700

----------------------------------------------------------------------
 .../scala/kafka/coordinator/transaction/TransactionMetadata.scala  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/1e03b711/core/src/main/scala/kafka/coordinator/transaction/TransactionMetadata.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/coordinator/transaction/TransactionMetadata.scala b/core/src/main/scala/kafka/coordinator/transaction/TransactionMetadata.scala
index cc9a2f7..7e9add3 100644
--- a/core/src/main/scala/kafka/coordinator/transaction/TransactionMetadata.scala
+++ b/core/src/main/scala/kafka/coordinator/transaction/TransactionMetadata.scala
@@ -285,7 +285,7 @@ private[transaction] class TransactionMetadata(val transactionalId: String,
     val toState = pendingState.getOrElse(throw new IllegalStateException(s"TransactionalId $transactionalId " +
       "completing transaction state transition while it does not have a pending state"))
 
-    if (toState != transitMetadata.txnState || txnLastUpdateTimestamp > transitMetadata.txnLastUpdateTimestamp) {
+    if (toState != transitMetadata.txnState) {
       throwStateTransitionFailure(toState)
     } else {
       toState match {