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

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

Reply via email to