Nickstery commented on code in PR #14104: URL: https://github.com/apache/kafka/pull/14104#discussion_r1303964994
########## core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java: ########## @@ -558,6 +614,134 @@ void testCopyLogSegmentsToRemoteShouldNotCopySegmentForFollower() throws Excepti verify(mockLog, never()).updateHighestOffsetInRemoteStorage(anyLong()); } + @Test + void testCopyLogSegmentsToRemoteShouldNotCopySegmentWithMissingIndexes() throws Exception { + long segmentStartOffset = 0L; + + // leader epoch preparation + checkpoint.write(totalEpochEntries); + LeaderEpochFileCache cache = new LeaderEpochFileCache(leaderTopicIdPartition.topicPartition(), checkpoint); + when(mockLog.leaderEpochCache()).thenReturn(Option.apply(cache)); + when(remoteLogMetadataManager.highestOffsetForEpoch(any(TopicIdPartition.class), anyInt())).thenReturn(Optional.of(0L)); + + // create log segment, with 0 as log start offset + LogSegment segment = mock(LogSegment.class); + + // Segment does not nage timeIndex() what is not acceptable to sanityChecks. Review Comment: Will be fixed, 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org