kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject kafka git commit: MINOR: Improve TransactionIndex.sanityCheck() message
Date Thu, 29 Jun 2017 16:51:40 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.11.0 8f7fd0716 -> ce1ca4ce1


MINOR: Improve TransactionIndex.sanityCheck() message

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #3446 from ijuma/improve-transaction-index-exception-sanity-check

(cherry picked from commit 27fdd46dcd303566a35d4824c571cf988912575e)
Signed-off-by: Jason Gustafson <jason@confluent.io>


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

Branch: refs/heads/0.11.0
Commit: ce1ca4ce14f306b279f48152b14244b47f55ac49
Parents: 8f7fd07
Author: Ismael Juma <ismael@juma.me.uk>
Authored: Thu Jun 29 09:51:04 2017 -0700
Committer: Jason Gustafson <jason@confluent.io>
Committed: Thu Jun 29 09:51:36 2017 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/log/TransactionIndex.scala | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/ce1ca4ce/core/src/main/scala/kafka/log/TransactionIndex.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/log/TransactionIndex.scala b/core/src/main/scala/kafka/log/TransactionIndex.scala
index f8a3879..9afe009 100644
--- a/core/src/main/scala/kafka/log/TransactionIndex.scala
+++ b/core/src/main/scala/kafka/log/TransactionIndex.scala
@@ -174,7 +174,8 @@ class TransactionIndex(val startOffset: Long, @volatile var file: File)
extends
   def sanityCheck(): Unit = {
     val buffer = ByteBuffer.allocate(AbortedTxn.TotalSize)
     for ((abortedTxn, _) <- iterator(() => buffer)) {
-      require(abortedTxn.lastOffset >= startOffset)
+      require(abortedTxn.lastOffset >= startOffset, s"Last offset of aborted transaction
$abortedTxn is less than " +
+        s"start offset $startOffset")
     }
   }
 


Mime
View raw message