showuon commented on code in PR #16781:
URL: https://github.com/apache/kafka/pull/16781#discussion_r1702425042
##########
core/src/test/scala/unit/kafka/server/ListOffsetsRequestTest.scala:
##########
@@ -92,19 +93,30 @@ class ListOffsetsRequestTest extends BaseRequestTest {
assertResponseError(Errors.NOT_LEADER_OR_FOLLOWER, nonReplica,
debugReplicaRequest)
}
- @ParameterizedTest
- @ValueSource(strings = Array("zk", "kraft"))
- def testListOffsetsMaxTimeStampOldestVersion(quorum: String): Unit = {
+ @Test
+ def testListOffsetsMaxTimeStampOldestVersion(): Unit = {
val consumerRequestBuilder = ListOffsetsRequest.Builder
- .forConsumer(false, IsolationLevel.READ_UNCOMMITTED, false)
+ .forConsumer(false, IsolationLevel.READ_UNCOMMITTED, false, false)
val maxTimestampRequestBuilder = ListOffsetsRequest.Builder
- .forConsumer(false, IsolationLevel.READ_UNCOMMITTED, true)
+ .forConsumer(false, IsolationLevel.READ_UNCOMMITTED, true, false)
assertEquals(0.toShort, consumerRequestBuilder.oldestAllowedVersion())
assertEquals(7.toShort, maxTimestampRequestBuilder.oldestAllowedVersion())
}
+ @Test
+ def testListOffsetsRequestTiredTimestampOldestVersion(): Unit = {
Review Comment:
typo: tiered
##########
core/src/test/scala/unit/kafka/server/ListOffsetsRequestTest.scala:
##########
@@ -92,19 +93,30 @@ class ListOffsetsRequestTest extends BaseRequestTest {
assertResponseError(Errors.NOT_LEADER_OR_FOLLOWER, nonReplica,
debugReplicaRequest)
}
- @ParameterizedTest
- @ValueSource(strings = Array("zk", "kraft"))
- def testListOffsetsMaxTimeStampOldestVersion(quorum: String): Unit = {
+ @Test
+ def testListOffsetsMaxTimeStampOldestVersion(): Unit = {
val consumerRequestBuilder = ListOffsetsRequest.Builder
- .forConsumer(false, IsolationLevel.READ_UNCOMMITTED, false)
+ .forConsumer(false, IsolationLevel.READ_UNCOMMITTED, false, false)
val maxTimestampRequestBuilder = ListOffsetsRequest.Builder
- .forConsumer(false, IsolationLevel.READ_UNCOMMITTED, true)
+ .forConsumer(false, IsolationLevel.READ_UNCOMMITTED, true, false)
assertEquals(0.toShort, consumerRequestBuilder.oldestAllowedVersion())
assertEquals(7.toShort, maxTimestampRequestBuilder.oldestAllowedVersion())
}
+ @Test
+ def testListOffsetsRequestTiredTimestampOldestVersion(): Unit = {
+ val consumerRequestBuilder = ListOffsetsRequest.Builder
+ .forConsumer(false, IsolationLevel.READ_UNCOMMITTED, false, false)
Review Comment:
This `consumerRequestBuilder` test is identical with the one in
`testListOffsetsMaxTimeStampOldestVersion`. I think we can integrate these 2
tests into 1, and rename to something like:
`testListOffsetsRequestOldestVersion` or something else. And I think (if we
have time), we also need to test `requireTimestamp` and `isolationLevel ==
IsolationLevel.READ_COMMITTED` since I didn't see there's test covered them.
WDYT?
##########
core/src/test/scala/unit/kafka/server/ListOffsetsRequestTest.scala:
##########
@@ -92,19 +93,30 @@ class ListOffsetsRequestTest extends BaseRequestTest {
assertResponseError(Errors.NOT_LEADER_OR_FOLLOWER, nonReplica,
debugReplicaRequest)
}
- @ParameterizedTest
- @ValueSource(strings = Array("zk", "kraft"))
- def testListOffsetsMaxTimeStampOldestVersion(quorum: String): Unit = {
+ @Test
+ def testListOffsetsMaxTimeStampOldestVersion(): Unit = {
Review Comment:
Why do we remove the original ZK and kraft infra's tests?
##########
clients/src/main/java/org/apache/kafka/clients/admin/internals/ListOffsetsHandler.java:
##########
@@ -93,8 +94,12 @@ ListOffsetsRequest.Builder buildBatchedRequest(int brokerId,
Set<TopicPartition>
.stream()
.anyMatch(key -> offsetTimestampsByPartition.get(key) ==
ListOffsetsRequest.MAX_TIMESTAMP);
+ boolean requireTiredTimestamp = keys
Review Comment:
nit: tired -> tiered
##########
clients/src/main/java/org/apache/kafka/clients/admin/internals/ListOffsetsHandler.java:
##########
@@ -93,8 +94,12 @@ ListOffsetsRequest.Builder buildBatchedRequest(int brokerId,
Set<TopicPartition>
.stream()
.anyMatch(key -> offsetTimestampsByPartition.get(key) ==
ListOffsetsRequest.MAX_TIMESTAMP);
+ boolean requireTiredTimestamp = keys
Review Comment:
Maybe rename to `requireTieredStorageTimestamp`
--
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]