squah-confluent commented on code in PR #18777:
URL: https://github.com/apache/kafka/pull/18777#discussion_r1938362005


##########
core/src/test/scala/integration/kafka/api/PlaintextConsumerSubscriptionTest.scala:
##########
@@ -215,6 +215,33 @@ class PlaintextConsumerSubscriptionTest extends 
AbstractConsumerTest {
     awaitAssignment(consumer, assignment)
   }
 
+  @ParameterizedTest(name = 
TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
+  
@MethodSource(Array("getTestQuorumAndGroupProtocolParametersConsumerGroupProtocolOnly"))
+  def testRe2JPatternSubscriptionFetch(quorum: String, groupProtocol: String): 
Unit = {

Review Comment:
   I'm not sure if this is the right place for the test to live.



##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerMetadata.java:
##########
@@ -94,6 +95,15 @@ protected synchronized boolean retainTopic(String topic, 
boolean isInternal, lon
         if (isInternal && !includeInternalTopics)
             return false;
 
+        // Keep leader metadata for topics matching the RE2J subscription.
+        // We aim to replaced this with something more efficient in 
KAFKA-18117.
+        if (subscription.hasRe2JPatternSubscription()) {
+            for (TopicPartition topicPartition : 
subscription.assignedPartitionsList()) {
+                if (topicPartition.topic().equals(topic))
+                    return true;
+            }
+        }
+

Review Comment:
   I wasn't sure where this should go.
   What's the difference between `retainTopic` and `needsMetadata`?



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