ijuma commented on code in PR #13043: URL: https://github.com/apache/kafka/pull/13043#discussion_r1056478004
########## core/src/main/scala/kafka/log/LogCleaner.scala: ########## @@ -681,9 +681,10 @@ private[log] class Cleaner(val id: Int, // 3) The last entry in the log is a transaction marker. We retain this marker since it has the // last producer epoch, which is needed to ensure fencing. lastRecordsOfActiveProducers.get(batch.producerId).exists { lastRecord => - lastRecord.lastDataOffset match { - case Some(offset) => batch.lastOffset == offset - case None => batch.isControlBatch && batch.producerEpoch == lastRecord.producerEpoch + if(lastRecord.lastDataOffset.isPresent) { Review Comment: Nit: space after `if`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org