jsancio commented on a change in pull request #9590: URL: https://github.com/apache/kafka/pull/9590#discussion_r523267025
########## File path: core/src/main/scala/kafka/log/LogCleaner.scala ########## @@ -711,6 +723,9 @@ private[log] class Cleaner(val id: Int, shallowOffsetOfMaxTimestamp = result.shallowOffsetOfMaxTimestamp, records = retained) throttler.maybeThrottle(outputBuffer.limit()) + if (newCanUpdateBaseOffset) + dest.updateBaseOffset(result.minOffset()) + newCanUpdateBaseOffset = false Review comment: I think one solution is to change the signature to: ```scala private[log] def cleanInto( log: Log sourceRecords: FileRecords, dest: Option[LogSegment], map: OffsetMap, retainDeletesAndTxnMarkers: Boolean, maxLogMessageSize: Int, transactionMetadata: CleanedTransactionMetadata, lastRecordsOfActiveProducers: Map[Long, LastRecord], stats: CleanerStats): Option[LogSegment] ``` This should allow you to call `LogCleaner.createNewCleanedSegment(log, result.minOffset)` when a cleaned batch has been identified. What do you think? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org