showuon commented on code in PR #14330:
URL: https://github.com/apache/kafka/pull/14330#discussion_r1317985188
##########
core/src/main/java/kafka/log/remote/RemoteLogManager.java:
##########
@@ -978,17 +978,17 @@ private void cleanupExpiredRemoteLogSegments() throws
RemoteStorageException, Ex
}
RemoteLogSegmentMetadata metadata =
segmentsIterator.next();
- // check whether the segment contains the required epoch
range with in the current leader epoch lineage.
- boolean isValidSegment =
isRemoteSegmentWithinLeaderEpochs(metadata, logEndOffset, epochWithOffsets);
- boolean isSegmentDeleted = false;
- if (isValidSegment) {
- isSegmentDeleted =
-
remoteLogRetentionHandler.deleteRetentionTimeBreachedSegments(metadata) ||
-
remoteLogRetentionHandler.deleteRetentionSizeBreachedSegments(metadata);
- }
+ boolean isSegmentDeleted =
remoteLogRetentionHandler.deleteLogStartOffsetBreachedSegments(
+ metadata, logStartOffset, epochWithOffsets);
Review Comment:
Thanks for the update. The logic makes sense now. Could you please add some
comment here to explain why we need to separate the
`deleteLogStartOffsetBreachedSegments` here? Thanks.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]