Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BA5DB200CB1 for ; Sat, 10 Jun 2017 02:08:47 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B8E6D160BD4; Sat, 10 Jun 2017 00:08:47 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0B22C160BCA for ; Sat, 10 Jun 2017 02:08:46 +0200 (CEST) Received: (qmail 12591 invoked by uid 500); 10 Jun 2017 00:08:41 -0000 Mailing-List: contact commits-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list commits@kafka.apache.org Received: (qmail 12582 invoked by uid 99); 10 Jun 2017 00:08:41 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Jun 2017 00:08:41 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BBBEFDFF16; Sat, 10 Jun 2017 00:08:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jgus@apache.org To: commits@kafka.apache.org Message-Id: <8bc2d8cd6bdc4de78f5dda80b7bcc38b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: kafka git commit: KAFKA-5415; Remove timestamp check in completeTransitionTo Date: Sat, 10 Jun 2017 00:08:39 +0000 (UTC) archived-at: Sat, 10 Jun 2017 00:08:47 -0000 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 Reviewers: Guozhang Wang , Jason Gustafson 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 Authored: Fri Jun 9 17:08:34 2017 -0700 Committer: Jason Gustafson 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 {