chia7712 commented on code in PR #16893:
URL: https://github.com/apache/kafka/pull/16893#discussion_r1718881868
##########
core/src/test/scala/unit/kafka/server/ListOffsetsRequestTest.scala:
##########
@@ -202,7 +210,17 @@ class ListOffsetsRequestTest extends BaseRequestTest {
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
- def testResponseIncludesLeaderEpoch(quorum: String): Unit = {
+ def testResponseIncludesLeaderEpochWithUnstableAPIs(quorum: String): Unit = {
+ testResponseIncludesLeaderEpoch()
+ }
+
+ @ParameterizedTest
+ @ValueSource(strings = Array("zk", "kraft"))
+ def testResponseIncludesLeaderEpochWithStableAPIs(quorum: String): Unit = {
+ testResponseIncludesLeaderEpoch()
+ }
+
+ def testResponseIncludesLeaderEpoch(): Unit = {
Review Comment:
Maybe we can have a IT used to make sure MV does not return "unstable"
version for inter broker communication. for example:
```java
@ClusterTests({
@ClusterTest(serverProperties = {@ClusterConfigProperty(key =
ServerConfigs.UNSTABLE_API_VERSIONS_ENABLE_CONFIG, value = "false")}),
@ClusterTest(serverProperties = {@ClusterConfigProperty(key =
ServerConfigs.UNSTABLE_API_VERSIONS_ENABLE_CONFIG, value = "true")})
})
public void test(ClusterInstance clusterInstance) {
clusterInstance.brokers().values().forEach(b -> {
MetadataVersion mv = b.metadataCache().metadataVersion();
Assertions.assertTrue(mv.listOffsetRequestVersion() <=
ApiKeys.LIST_OFFSETS.latestVersion(false));
Assertions.assertTrue(mv.fetchRequestVersion() <=
ApiKeys.FETCH.latestVersion(false));
Assertions.assertTrue(mv.offsetForLeaderEpochRequestVersion() <=
ApiKeys.OFFSET_FOR_LEADER_EPOCH.latestVersion(false));
});
}
```
--
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]