kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject kafka git commit: KAFKA-5415; Remove timestamp check in completeTransitionTo
Date Sat, 10 Jun 2017 00:08:39 GMT
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 <apurva@confluent.io>

Reviewers: Guozhang Wang <wangguoz@gmail.com>, Jason Gustafson <jason@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 <apurva@confluent.io>
Authored: Fri Jun 9 17:08:34 2017 -0700
Committer: Jason Gustafson <jason@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 {


Mime
View raw message