This is an automated email from the ASF dual-hosted git repository.
penghui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new ae0153c4374 [improve][broker] Support setting
`ForceDeleteNamespaceAllowed` dynamically (#18181)
ae0153c4374 is described below
commit ae0153c4374751e89f9e6222de63068026b93cfd
Author: Jiwei Guo <[email protected]>
AuthorDate: Tue Oct 25 22:07:13 2022 +0800
[improve][broker] Support setting `ForceDeleteNamespaceAllowed` dynamically
(#18181)
---
.../java/org/apache/pulsar/broker/ServiceConfiguration.java | 1 +
.../org/apache/pulsar/broker/service/BrokerServiceTest.java | 12 ++++++++++++
2 files changed, 13 insertions(+)
diff --git
a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
index 427c6489114..f0725353dd7 100644
---
a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
+++
b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
@@ -649,6 +649,7 @@ public class ServiceConfiguration implements
PulsarConfiguration {
@FieldContext(
category = CATEGORY_POLICIES,
+ dynamic = true,
doc = "Allow forced deletion of namespaces. Default is false."
)
private boolean forceDeleteNamespaceAllowed = false;
diff --git
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceTest.java
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceTest.java
index f6f37452e71..eb9447b47fe 100644
---
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceTest.java
+++
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceTest.java
@@ -1496,4 +1496,16 @@ public class BrokerServiceTest extends BrokerTestBase {
.subscriptionType(SubscriptionType.Shared)
.subscribe();
}
+
+ @Test
+ public void testDynamicConfigurationsForceDeleteNamespaceAllowed() throws
Exception {
+ cleanup();
+ conf.setForceDeleteNamespaceAllowed(false);
+ setup();
+ admin.brokers()
+ .updateDynamicConfiguration("forceDeleteNamespaceAllowed",
"true");
+ Awaitility.await().untilAsserted(()->{
+ assertTrue(conf.isForceDeleteNamespaceAllowed());
+ });
+ }
}