You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/09/07 14:32:01 UTC

[GitHub] [kafka] vvcephei commented on a diff in pull request #12594: MINOR: Include all hosts in metadata for topology

vvcephei commented on code in PR #12594:
URL: https://github.com/apache/kafka/pull/12594#discussion_r964920274


##########
streams/src/test/java/org/apache/kafka/streams/integration/NamedTopologyIntegrationTest.java:
##########
@@ -924,8 +926,10 @@ private void verifyPartitionsAndStoresForTopology(final String topologyName, fin
                                                             .collect(Collectors.toList())),
             is(true));
 
-        // then verify that only this topology's one store appears
-        assertThat(metadata.stateStoreNames(), equalTo(singleton("store-" + topologyName)));
+        // then verify that only this topology's one store appears if the host has partitions assigned
+        if (!metadata.topicPartitions().isEmpty()) {
+            assertThat(metadata.stateStoreNames(), equalTo(singleton("store-" + topologyName)));
+        }

Review Comment:
   It seems like this test is generally missing the converse:
   
   In addition to checking if all the assigned topics are in the named topology sources, should we also check that all named topology sources are assigned?
   
   Likewise, in this new block, should we assert that the store is not present if the partition is not assigned?



##########
streams/src/test/java/org/apache/kafka/streams/integration/NamedTopologyIntegrationTest.java:
##########
@@ -422,6 +422,8 @@ public void shouldAddAndRemoveNamedTopologiesBeforeStartingAndRouteQueriesToCorr
                 TOPOLOGY_1,
                 streams.allStreamsClientsMetadataForTopology(TOPOLOGY_1),
                 streams2.allStreamsClientsMetadataForTopology(TOPOLOGY_1));
+            assertThat(streams.allStreamsClientsMetadataForTopology(TOPOLOGY_2).size(), equalTo(2));
+            assertThat(streams2.allStreamsClientsMetadataForTopology(TOPOLOGY_2).size(), equalTo(2));

Review Comment:
   Should we also verify that topology1 metadata includes the full set of hosts?



-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org