FrankYang0529 commented on code in PR #18889:
URL: https://github.com/apache/kafka/pull/18889#discussion_r1957057125


##########
core/src/test/scala/integration/kafka/api/ConsumerWithLegacyMessageFormatIntegrationTest.scala:
##########
@@ -80,12 +114,12 @@ class ConsumerWithLegacyMessageFormatIntegrationTest 
extends AbstractConsumerTes
     val timestampTopic2P0 = timestampOffsets.get(new TopicPartition(topic2, 0))
     assertEquals(40, timestampTopic2P0.offset)
     assertEquals(40, timestampTopic2P0.timestamp)
-    assertEquals(Optional.of(0), timestampTopic2P0.leaderEpoch)
+    assertEquals(Optional.empty, timestampTopic2P0.leaderEpoch)

Review Comment:
   The commit 
https://github.com/apache/kafka/commit/8cdf1abb0b89f1f9f85fb1acb4cc8b83f527d16a 
included KRaft support for `ConsumerWithLegacyMessageFormatIntegrationTest`. 
However, it didn't really set topic to use v0 format. The KRaft used inter 
broker protocol version 3.0-IV1, so the message format version is ignored. 
That's why we could get leader epoch for topic2.
   
   
https://github.com/apache/kafka/blob/c455c10405a4a201912e35a52ca1e6aef36e5af9/core/src/main/scala/kafka/server/ConfigHandler.scala#L167-L172



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

Reply via email to