mirror of https://github.com/apache/kafka.git
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
This commit is contained in:
parent
dc95456f1d
commit
27fdd46dcd
|
@ -174,7 +174,8 @@ class TransactionIndex(val startOffset: Long, @volatile var file: File) extends
|
||||||
def sanityCheck(): Unit = {
|
def sanityCheck(): Unit = {
|
||||||
val buffer = ByteBuffer.allocate(AbortedTxn.TotalSize)
|
val buffer = ByteBuffer.allocate(AbortedTxn.TotalSize)
|
||||||
for ((abortedTxn, _) <- iterator(() => buffer)) {
|
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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue