kamalcph commented on code in PR #15141: URL: https://github.com/apache/kafka/pull/15141#discussion_r1444176340
########## core/src/main/scala/kafka/log/UnifiedLog.scala: ########## @@ -1510,10 +1510,21 @@ class UnifiedLog(@volatile var logStartOffset: Long, } } localLog.checkIfMemoryMappedBufferClosed() - // remove the segments for lookups - localLog.removeAndDeleteSegments(segmentsToDelete, asyncDelete = true, reason) - deleteProducerSnapshots(deletable, asyncDelete = true) - incrementStartOffset(localLog.segments.firstSegmentBaseOffset.getAsLong, LogStartOffsetIncrementReason.SegmentDeletion) + if (remoteLogEnabled()) { + /** + * See @link{https://issues.apache.org/jira/browse/KAFKA-16073} for the background of this fix + */ + val newLocalLogStartOffset = localLog.segments.higherSegment(deletable.last.baseOffset()).get().baseOffset() Review Comment: Seems the active-segment deletion case is already handled, when the topic is enabled with remote-log-storage, then the below condition will always be false: ``` if (localLog.segments.numberOfSegments == numToDelete) ``` -- 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