jeqo commented on code in PR #14727:
URL: https://github.com/apache/kafka/pull/14727#discussion_r1392302131


##########
core/src/main/java/kafka/log/remote/RemoteLogManager.java:
##########
@@ -988,6 +998,10 @@ void cleanupExpiredRemoteLogSegments() throws 
RemoteStorageException, ExecutionE
                         return;
                     }
                     RemoteLogSegmentMetadata metadata = 
segmentsIterator.next();
+
+                    if 
(!SEGMENT_DELETION_VALID_STATES.contains(metadata.state())) {

Review Comment:
   Good idea, applying change.



##########
core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java:
##########
@@ -1652,22 +1679,23 @@ public void 
testDeleteLogSegmentDueToRetentionSizeBreach(int segmentCount,
         
when(mockLog.onlyLocalLogSegmentsSize()).thenReturn(localLogSegmentsSize);
 
         List<RemoteLogSegmentMetadata> segmentMetadataList = 
listRemoteLogSegmentMetadata(
-                leaderTopicIdPartition, segmentCount, recordsPerSegment, 
segmentSize, epochEntries);
+            leaderTopicIdPartition, segmentCount, recordsPerSegment, 
segmentSize, epochEntries, state);
         verifyDeleteLogSegment(segmentMetadataList, deletableSegmentCount, 
currentLeaderEpoch);
     }
 
     @ParameterizedTest(name = "testDeleteLogSegmentDueToRetentionTimeBreach 
segmentCount={0} deletableSegmentCount={1}")
-    @CsvSource(value = {"50, 0", "50, 1", "50, 23", "50, 50"})
+    @CsvSource(value = {"50, 0, DELETE_SEGMENT_STARTED", "50, 1, 
COPY_SEGMENT_FINISHED", "50, 23, DELETE_SEGMENT_STARTED", "50, 50, 
COPY_SEGMENT_FINISHED"})

Review Comment:
   Agree, applying suggestion



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

Reply via email to