Technoboy- commented on code in PR #15663:
URL: https://github.com/apache/pulsar/pull/15663#discussion_r881364680


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/systopic/PartitionedSystemTopicTest.java:
##########
@@ -171,4 +177,56 @@ public void testHealthCheckTopicNotOffload() throws 
Exception {
         });
     }
 
+    @Test
+    private void testSetBacklogCausedCreatingProducerFailure() throws 
Exception {
+        final String ns = "prop/ns-test";
+        final String topic = ns + "/topic-1";
+
+        admin.namespaces().createNamespace(ns, 2);
+        admin.topics().createPartitionedTopic(String.format("persistent://%s", 
topic), 1);
+        BacklogQuota quota = BacklogQuota.builder()
+                .limitTime(30)
+                .limitSize(-1)
+                
.retentionPolicy(BacklogQuota.RetentionPolicy.producer_exception)
+                .build();
+        admin.namespaces().setBacklogQuota(ns, quota, 
BacklogQuota.BacklogQuotaType.message_age);
+
+        @Cleanup
+        Producer<String> producer = pulsarClient.newProducer(Schema.STRING)
+                .topic(topic)
+                .create();
+
+        String partition0 = TopicName.get(String.format("persistent://%s", 
topic)).getPartition(0).toString();
+        Optional<Topic> topicReference = 
pulsar.getBrokerService().getTopicReference(partition0);
+        Assert.assertTrue(topicReference.isPresent());
+        PersistentTopic persistentTopic = (PersistentTopic) 
topicReference.get();
+        
persistentTopic.getManagedLedger().getConfig().setMinimumRolloverTime(3, 
TimeUnit.SECONDS);
+        
persistentTopic.getManagedLedger().getConfig().setMaximumRolloverTime(3, 
TimeUnit.SECONDS);

Review Comment:
   No need, because if we set ledger config, some other params are not updated 
here. especially the scheduled task.



-- 
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: commits-unsubscr...@pulsar.apache.org

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

Reply via email to