kamalcph commented on code in PR #15141:
URL: https://github.com/apache/kafka/pull/15141#discussion_r1444171600


##########
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:
   We should handle the case where we are deleting the only segment which is 
active segment. 
   



-- 
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

Reply via email to