kamalcph commented on code in PR #16584:
URL: https://github.com/apache/kafka/pull/16584#discussion_r2296569926


##########
core/src/test/scala/unit/kafka/log/UnifiedLogTest.scala:
##########
@@ -2416,6 +2416,193 @@ class UnifiedLogTest {
     KafkaConfig.fromProps(props)
   }
 
+  @Test
+  def testFetchEarliestPendingUploadTimestampNoRemoteStorage(): Unit = {
+    val logConfig = LogTestUtils.createLogConfig(segmentBytes = 200, 
indexIntervalBytes = 1)
+    val log = createLog(logDir, logConfig)
+
+    // Test initial state before any records
+    assertFetchOffsetBySpecialTimestamp(log, None, new 
TimestampAndOffset(ListOffsetsResponse.UNKNOWN_TIMESTAMP, -1, Optional.of(-1)),
+      ListOffsetsRequest.EARLIEST_PENDING_UPLOAD_TIMESTAMP)
+
+    // Append records
+    val _ = prepareLogWithSequentialRecords(log, recordCount = 2)
+
+    // Test state after records are appended
+    assertFetchOffsetBySpecialTimestamp(log, None, new 
TimestampAndOffset(ListOffsetsResponse.UNKNOWN_OFFSET, -1, Optional.of(-1)),
+      ListOffsetsRequest.EARLIEST_PENDING_UPLOAD_TIMESTAMP)

Review Comment:
   should this be updated to? 
   
   ListOffsetsResponse.UNKNOWN_OFFSET -> ListOffsetsResponse.UNKNOWN_TIMESTAMP?



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

Reply via email to