malletgu commented on code in PR #16959:
URL: https://github.com/apache/kafka/pull/16959#discussion_r1732605911
##########
core/src/main/java/kafka/log/remote/RemoteLogManager.java:
##########
@@ -1254,7 +1265,10 @@ void cleanupExpiredRemoteLogSegments() throws
RemoteStorageException, ExecutionE
canProcess = false;
continue;
}
- if
(RemoteLogSegmentState.DELETE_SEGMENT_FINISHED.equals(metadata.state())) {
+ // skip the COPY_SEGMENT_STARTED segments since they might
be the dangling segments that failed before
+ // and blocks the normal segment deletion, ex: it failed
`isRemoteSegmentWithinLeaderEpochs` check... etc
+ if
(RemoteLogSegmentState.DELETE_SEGMENT_FINISHED.equals(metadata.state()) ||
+
RemoteLogSegmentState.COPY_SEGMENT_STARTED.equals(metadata.state())) {
Review Comment:
I thought about this when I first had a look at it and one thing that
bothered me is that `DELETE_SEGMENT_STARTED` means to me that we're now in a
state where we attempt deletion. However if the remote store is down and we
fail to copy and delete we will leave that segment in `DELETE_SEGMENT_STARTED`
and not attempt to delete it till the segment itself breaches
retention.ms/bytes.
We can probably just make it clearer but that was my thought at the time.
--
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]