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/06/20 13:55:14 UTC

[GitHub] [kafka] divijvaidya commented on a diff in pull request #12286: KAFKA-13984: Fix TopicBasedRemoteLogMetadataManager#initializeResources should exit immediately when partition size of __remote_log_metadata is not same as configured

divijvaidya commented on code in PR #12286:
URL: https://github.com/apache/kafka/pull/12286#discussion_r901679350


##########
storage/src/test/java/org/apache/kafka/server/log/remote/metadata/storage/TopicBasedRemoteLogMetadataManagerRestartTest.java:
##########
@@ -68,10 +72,27 @@ protected Map<String, Object> overrideRemoteLogMetadataManagerProps() {
         remoteLogMetadataManagerHarness.initialize(Collections.emptySet(), true);
     }
 
-    private void startTopicBasedRemoteLogMetadataManagerHarness(boolean startConsumerThread) {
-        remoteLogMetadataManagerHarness.initializeRemoteLogMetadataManager(Collections.emptySet(), startConsumerThread);
+    private void startTopicBasedRemoteLogMetadataManagerHarness(boolean startConsumerThread,
+                                                                int remoteLogMetadataTopicPartitionCount) {
+        remoteLogMetadataManagerHarness.initializeRemoteLogMetadataManager(Collections.emptySet(), startConsumerThread,
+                remoteLogMetadataTopicPartitionCount);
     }
 
+
+    @Test
+    public void testRLMMInitializeResources() throws Exception {
+        assertTrue(topicBasedRlmm().isInitialized());
+
+        stopTopicBasedRemoteLogMetadataManagerHarness();
+        assertThrows(KafkaException.class, () -> startTopicBasedRemoteLogMetadataManagerHarness(false, 4));

Review Comment:
   please replace hard coded `4` with `METADATA_TOPIC_PARTITIONS_COUNT + 1`. This would make it explicit state that we are starting RLMM with a partition value different from existing one here. Even better would be if we can get the number of partitions of existing topic and use `that + 1` here instead of METADATA_TOPIC_PARTITIONS_COUNT. 



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