satishd commented on code in PR #14128:
URL: https://github.com/apache/kafka/pull/14128#discussion_r1280069565
##########
core/src/main/java/kafka/log/remote/RemoteLogManager.java:
##########
@@ -1002,4 +1004,36 @@ public void close() {
}
}
+ static class CandidateLogSegment {
Review Comment:
Can you rename it to `LogSegmentWithNextOffset` or a better name?
##########
core/src/main/java/kafka/log/remote/RemoteLogManager.java:
##########
@@ -1002,4 +1004,36 @@ public void close() {
}
}
+ static class CandidateLogSegment {
Review Comment:
Add a comment that it is visible only for testing.
##########
core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java:
##########
@@ -269,15 +269,37 @@ void testStartup() {
void testCopyLogSegmentsToRemoteShouldCopyExpectedLogSegment() throws
Exception {
long oldSegmentStartOffset = 0L;
long nextSegmentStartOffset = 150L;
- long oldSegmentEndOffset = nextSegmentStartOffset - 1;
+ long lso = 250L;
+ long leo = 300L;
+ assertCopyExpectedLogSegmentsToRemote(oldSegmentStartOffset,
nextSegmentStartOffset, lso, leo);
+ }
+
+ /**
+ * The following values will be equal when the active segment gets rotated
to passive and there are no new messages:
+ * last-stable-offset = high-water-mark = log-end-offset =
base-offset-of-active-segment.
+ * This test asserts that the active log segment that was rotated after
log.roll.ms are copied to remote storage.
+ */
+ @Test
+ void testCopyLogSegmentToRemoteForStaleTopic() throws Exception {
Review Comment:
Good test for the edge case of a stale topic with no activity for longer
durations.
--
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]