diff --git a/conf/broker.conf b/conf/broker.conf index d9309ff04bb0c0680bc3320d14187331faf43bef..eae9cc7ea1cb041cbb9c1b96815f015396e429a2 100644 --- a/conf/broker.conf +++ b/conf/broker.conf @@ -698,9 +698,6 @@ defaultRetentionSizeInMB=0 # How often to check whether the connections are still alive keepAliveIntervalSeconds=30 -# How often broker checks for inactive topics to be deleted (topics with no subscriptions and no one connected) -brokerServicePurgeInactiveFrequencyInSeconds=60 - # bootstrap namespaces bootstrapNamespaces= @@ -814,6 +811,9 @@ globalZookeeperServers= # Deprecated - Enable TLS when talking with other clusters to replicate messages replicationTlsEnabled=false +# Deprecated. Use brokerDeleteInactiveTopicsFrequencySeconds +brokerServicePurgeInactiveFrequencyInSeconds=60 + ### --- Transaction config variables --- ### # Enable transaction coordinator in broker diff --git a/conf/standalone.conf b/conf/standalone.conf index 862dc10a0fd4f7748e1ab3f581d312a299af0458..6efd1cd585dbac8ffa7bfee4acf4b0f057610466 100644 --- a/conf/standalone.conf +++ b/conf/standalone.conf @@ -495,9 +495,6 @@ defaultRetentionSizeInMB=0 # How often to check whether the connections are still alive keepAliveIntervalSeconds=30 -# How often broker checks for inactive topics to be deleted (topics with no subscriptions and no one connected) -brokerServicePurgeInactiveFrequencyInSeconds=60 - ### --- WebSocket --- ### # Enable the WebSocket API service in broker @@ -530,6 +527,8 @@ exposePublisherStats=true # Deprecated. Use configurationStoreServers globalZookeeperServers= +# Deprecated. Use brokerDeleteInactiveTopicsFrequencySeconds +brokerServicePurgeInactiveFrequencyInSeconds=60 ### --- BookKeeper Configuration --- ##### diff --git a/deployment/terraform-ansible/templates/broker.conf b/deployment/terraform-ansible/templates/broker.conf index 22f74be355f043b0bfc22006bec156594d59c366..1f78a355b7f7b9c996aca82b5988a73be656a0bf 100644 --- a/deployment/terraform-ansible/templates/broker.conf +++ b/deployment/terraform-ansible/templates/broker.conf @@ -453,9 +453,6 @@ defaultRetentionSizeInMB=0 # How often to check whether the connections are still alive keepAliveIntervalSeconds=30 -# How often broker checks for inactive topics to be deleted (topics with no subscriptions and no one connected) -brokerServicePurgeInactiveFrequencyInSeconds=60 - ### --- WebSocket --- ### # Enable the WebSocket API service in broker @@ -514,3 +511,6 @@ s3ManagedLedgerOffloadReadBufferSizeInBytes=1048576 # Deprecated. Use configurationStoreServers globalZookeeperServers={{ zookeeper_servers }} + +# Deprecated. Use brokerDeleteInactiveTopicsFrequencySeconds +brokerServicePurgeInactiveFrequencyInSeconds=60 \ No newline at end of file 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 ac479b0d6b916c204c55ee1c3a923e0c5d6d4cff..70c70003a581ecfe25adc42090d944531adf53b0 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 @@ -253,7 +253,7 @@ public class ServiceConfiguration implements PulsarConfiguration { category = CATEGORY_POLICIES, doc = "How often to check for inactive topics" ) - private long brokerDeleteInactiveTopicsFrequencySeconds = 60; + private int brokerDeleteInactiveTopicsFrequencySeconds = 60; @FieldContext( category = CATEGORY_POLICIES, doc = "How frequently to proactively check and purge expired messages" @@ -1219,9 +1219,12 @@ public class ServiceConfiguration implements PulsarConfiguration { doc = "How often to check pulsar connection is still alive" ) private int keepAliveIntervalSeconds = 30; + @Deprecated @FieldContext( category = CATEGORY_POLICIES, + deprecated = true, doc = "How often broker checks for inactive topics to be deleted (topics with no subscriptions and no one connected)" + + "Deprecated in favor of using `brokerDeleteInactiveTopicsFrequencySeconds`" ) private int brokerServicePurgeInactiveFrequencyInSeconds = 60; @FieldContext( diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java index 674ca9da297aeab7ebfa2a3dc1b9ec1bec7588af..0e26dc5834808336b222605fbc88f3bcf164578f 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java @@ -404,7 +404,7 @@ public class BrokerService implements Closeable, ZooKeeperCacheListener checkGC(interval)), interval, interval, TimeUnit.SECONDS); } diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTestBase.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTestBase.java index edb2f6c4477b3b96d25e5d9d3729633c9aa94b91..d0b0f16e6222f81c774aff065a3dd1e3d0a22236 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTestBase.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTestBase.java @@ -124,7 +124,7 @@ public class ReplicatorTestBase { config1.setZookeeperServers("127.0.0.1:" + zkPort1); config1.setConfigurationStoreServers("127.0.0.1:" + globalZKPort + "/foo"); config1.setBrokerDeleteInactiveTopicsEnabled(isBrokerServicePurgeInactiveTopic()); - config1.setBrokerServicePurgeInactiveFrequencyInSeconds( + config1.setBrokerDeleteInactiveTopicsFrequencySeconds( inSec(getBrokerServicePurgeInactiveFrequency(), TimeUnit.SECONDS)); config1.setBrokerServicePort(Optional.ofNullable(PortManager.nextFreePort())); config1.setBrokerServicePortTls(Optional.ofNullable(PortManager.nextFreePort())); @@ -159,7 +159,7 @@ public class ReplicatorTestBase { config2.setZookeeperServers("127.0.0.1:" + zkPort2); config2.setConfigurationStoreServers("127.0.0.1:" + globalZKPort + "/foo"); config2.setBrokerDeleteInactiveTopicsEnabled(isBrokerServicePurgeInactiveTopic()); - config2.setBrokerServicePurgeInactiveFrequencyInSeconds( + config2.setBrokerDeleteInactiveTopicsFrequencySeconds( inSec(getBrokerServicePurgeInactiveFrequency(), TimeUnit.SECONDS)); config2.setBrokerServicePort(Optional.ofNullable(PortManager.nextFreePort())); config2.setBrokerServicePortTls(Optional.ofNullable(PortManager.nextFreePort())); @@ -194,7 +194,7 @@ public class ReplicatorTestBase { config3.setZookeeperServers("127.0.0.1:" + zkPort3); config3.setConfigurationStoreServers("127.0.0.1:" + globalZKPort + "/foo"); config3.setBrokerDeleteInactiveTopicsEnabled(isBrokerServicePurgeInactiveTopic()); - config3.setBrokerServicePurgeInactiveFrequencyInSeconds( + config3.setBrokerDeleteInactiveTopicsFrequencySeconds( inSec(getBrokerServicePurgeInactiveFrequency(), TimeUnit.SECONDS)); config3.setBrokerServicePort(Optional.ofNullable(PortManager.nextFreePort())); config3.setBrokerServicePortTls(Optional.ofNullable(PortManager.nextFreePort())); diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonPersistentTopicTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonPersistentTopicTest.java index 792ec216e182b1474a6213e2c44757e85e6345c5..5971f4a5bc585d9a8a9dc06397836360a4d9524d 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonPersistentTopicTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonPersistentTopicTest.java @@ -890,7 +890,7 @@ public class NonPersistentTopicTest extends ProducerConsumerBase { config1.setZookeeperServers("127.0.0.1:" + zkPort1); config1.setConfigurationStoreServers("127.0.0.1:" + globalZKPort + "/foo"); config1.setBrokerDeleteInactiveTopicsEnabled(isBrokerServicePurgeInactiveTopic()); - config1.setBrokerServicePurgeInactiveFrequencyInSeconds( + config1.setBrokerDeleteInactiveTopicsFrequencySeconds( inSec(getBrokerServicePurgeInactiveFrequency(), TimeUnit.SECONDS)); config1.setBrokerServicePort(Optional.ofNullable(PortManager.nextFreePort())); config1.setBacklogQuotaCheckIntervalInSeconds(TIME_TO_CHECK_BACKLOG_QUOTA); @@ -918,7 +918,7 @@ public class NonPersistentTopicTest extends ProducerConsumerBase { config2.setZookeeperServers("127.0.0.1:" + zkPort2); config2.setConfigurationStoreServers("127.0.0.1:" + globalZKPort + "/foo"); config2.setBrokerDeleteInactiveTopicsEnabled(isBrokerServicePurgeInactiveTopic()); - config2.setBrokerServicePurgeInactiveFrequencyInSeconds( + config2.setBrokerDeleteInactiveTopicsFrequencySeconds( inSec(getBrokerServicePurgeInactiveFrequency(), TimeUnit.SECONDS)); config2.setBrokerServicePort(Optional.ofNullable(PortManager.nextFreePort())); config2.setBacklogQuotaCheckIntervalInSeconds(TIME_TO_CHECK_BACKLOG_QUOTA); @@ -946,7 +946,7 @@ public class NonPersistentTopicTest extends ProducerConsumerBase { config3.setZookeeperServers("127.0.0.1:" + zkPort3); config3.setConfigurationStoreServers("127.0.0.1:" + globalZKPort + "/foo"); config3.setBrokerDeleteInactiveTopicsEnabled(isBrokerServicePurgeInactiveTopic()); - config3.setBrokerServicePurgeInactiveFrequencyInSeconds( + config3.setBrokerDeleteInactiveTopicsFrequencySeconds( inSec(getBrokerServicePurgeInactiveFrequency(), TimeUnit.SECONDS)); config3.setBrokerServicePort(Optional.ofNullable(PortManager.nextFreePort())); config3.setAllowAutoTopicCreationType("non-partitioned"); diff --git a/pulsar-client-cpp/test-conf/standalone-ssl.conf b/pulsar-client-cpp/test-conf/standalone-ssl.conf index 393cde29d3e0ac4f30702ad093cb0c59a06a528a..9e1d675f654bcd85638083d0068f132dbdba955b 100644 --- a/pulsar-client-cpp/test-conf/standalone-ssl.conf +++ b/pulsar-client-cpp/test-conf/standalone-ssl.conf @@ -22,9 +22,6 @@ # Zookeeper quorum connection string zookeeperServers= -# Deprecated. Global zookeeper quorum connection string -globalZookeeperServers= - # Configuration Store connection string configurationStoreServers= @@ -278,9 +275,6 @@ defaultRetentionSizeInMB=0 # How often to check whether the connections are still alive keepAliveIntervalSeconds=30 -# How often broker checks for inactive topics to be deleted (topics with no subscriptions and no one connected) -brokerServicePurgeInactiveFrequencyInSeconds=60 - # Enable topic auto creation if new producer or consumer connected (disable auto creation with value false) allowAutoTopicCreation=true @@ -288,4 +282,12 @@ allowAutoTopicCreation=true allowAutoTopicCreationType=non-partitioned # The number of partitioned topics that is allowed to be automatically created if allowAutoTopicCreationType is partitioned. -defaultNumPartitions=1 \ No newline at end of file +defaultNumPartitions=1 + +### --- Deprecated config variables --- ### + +# Deprecated. Use configurationStoreServers +globalZookeeperServers={{ zookeeper_servers }} + +# Deprecated. Use brokerDeleteInactiveTopicsFrequencySeconds +brokerServicePurgeInactiveFrequencyInSeconds=60 \ No newline at end of file diff --git a/pulsar-client-cpp/test-conf/standalone.conf b/pulsar-client-cpp/test-conf/standalone.conf index fee4146bf9d921da1dba627d568bd132db0a4db4..0f74cb9c7ebc11be79c93cef337174c4b0ce91c8 100644 --- a/pulsar-client-cpp/test-conf/standalone.conf +++ b/pulsar-client-cpp/test-conf/standalone.conf @@ -22,8 +22,8 @@ # Zookeeper quorum connection string zookeeperServers= -# Global Zookeeper quorum connection string -globalZookeeperServers= +# Configuration Store connection string +configurationStoreServers= brokerServicePort=8885 @@ -263,9 +263,6 @@ defaultRetentionSizeInMB=0 # How often to check whether the connections are still alive keepAliveIntervalSeconds=30 -# How often broker checks for inactive topics to be deleted (topics with no subscriptions and no one connected) -brokerServicePurgeInactiveFrequencyInSeconds=60 - # Enable topic auto creation if new producer or consumer connected (disable auto creation with value false) allowAutoTopicCreation=true @@ -273,4 +270,12 @@ allowAutoTopicCreation=true allowAutoTopicCreationType=non-partitioned # The number of partitioned topics that is allowed to be automatically created if allowAutoTopicCreationType is partitioned. -defaultNumPartitions=1 \ No newline at end of file +defaultNumPartitions=1 + +### --- Deprecated config variables --- ### + +# Deprecated. Use configurationStoreServers +globalZookeeperServers={{ zookeeper_servers }} + +# Deprecated. Use brokerDeleteInactiveTopicsFrequencySeconds +brokerServicePurgeInactiveFrequencyInSeconds=60 \ No newline at end of file diff --git a/pulsar-client-cpp/tests/authentication.conf b/pulsar-client-cpp/tests/authentication.conf index 25d7e30f93e9fd2c3dc627adb5105f4be1e174c7..11df3a6c08c585a49878808c64d03ae052ed88e3 100644 --- a/pulsar-client-cpp/tests/authentication.conf +++ b/pulsar-client-cpp/tests/authentication.conf @@ -22,9 +22,6 @@ # Zookeeper quorum connection string zookeeperServers= -# Deprecated. Global Zookeeper quorum connection string -globalZookeeperServers= - # Configuration Store connection string configurationStoreServers= @@ -272,5 +269,10 @@ defaultRetentionSizeInMB=0 # How often to check whether the connections are still alive keepAliveIntervalSeconds=30 -# How often broker checks for inactive topics to be deleted (topics with no subscriptions and no one connected) +### --- Deprecated config variables --- ### + +# Deprecated. Use configurationStoreServers +globalZookeeperServers= + +# Deprecated. Use brokerDeleteInactiveTopicsFrequencySeconds brokerServicePurgeInactiveFrequencyInSeconds=60 diff --git a/pulsar-client-cpp/tests/standalone.conf b/pulsar-client-cpp/tests/standalone.conf index 857285ab3d570ac904b355f45179b051dfe870b6..45574084779a6c9792c8edef3240555c42dfa73a 100644 --- a/pulsar-client-cpp/tests/standalone.conf +++ b/pulsar-client-cpp/tests/standalone.conf @@ -22,9 +22,6 @@ # Zookeeper quorum connection string zookeeperServers= -# Deprecated. Global Zookeeper quorum connection string -globalZookeeperServers= - # Configuration Store connection string configurationStoreServers= @@ -264,9 +261,6 @@ defaultRetentionSizeInMB=0 # How often to check whether the connections are still alive keepAliveIntervalSeconds=30 -# How often broker checks for inactive topics to be deleted (topics with no subscriptions and no one connected) -brokerServicePurgeInactiveFrequencyInSeconds=60 - # Enable topic auto creation if new producer or consumer connected (disable auto creation with value false) allowAutoTopicCreation=true @@ -275,3 +269,11 @@ allowAutoTopicCreationType=non-partitioned # The number of partitioned topics that is allowed to be automatically created if allowAutoTopicCreationType is partitioned. defaultNumPartitions=1 + +### --- Deprecated config variables --- ### + +# Deprecated. Use configurationStoreServers +globalZookeeperServers={{ zookeeper_servers }} + +# Deprecated. Use brokerDeleteInactiveTopicsFrequencySeconds +brokerServicePurgeInactiveFrequencyInSeconds=60 \ No newline at end of file diff --git a/site2/docs/reference-configuration.md b/site2/docs/reference-configuration.md index 6dfe87eeaeb45a735d085f3009db9f1668d080dd..e222814aa03e349bca4c88455f9cda9463b18104 100644 --- a/site2/docs/reference-configuration.md +++ b/site2/docs/reference-configuration.md @@ -221,7 +221,6 @@ Pulsar brokers are responsible for handling incoming messages from producers, di |defaultRetentionTimeInMinutes| Default message retention time || |defaultRetentionSizeInMB| Default retention size |0| |keepAliveIntervalSeconds| How often to check whether the connections are still alive |30| -|brokerServicePurgeInactiveFrequencyInSeconds| How often broker checks for inactive topics to be deleted (topics with no subscriptions and no one connected) |60| |loadManagerClassName| Name of load manager to use |org.apache.pulsar.broker.loadbalance.impl.SimpleLoadManagerImpl| |managedLedgerOffloadDriver| Driver to use to offload old data to long term storage (Possible values: S3) || |managedLedgerOffloadMaxThreads| Maximum number of thread pool threads for ledger offloading |2| @@ -395,7 +394,6 @@ The [`pulsar-client`](reference-cli-tools.md#pulsar-client) CLI tool can be used |defaultRetentionTimeInMinutes| |0| |defaultRetentionSizeInMB| |0| |keepAliveIntervalSeconds| |30| -|brokerServicePurgeInactiveFrequencyInSeconds| |60| diff --git a/site2/website/versioned_docs/version-2.4.0/reference-configuration.md b/site2/website/versioned_docs/version-2.4.0/reference-configuration.md index cb5b96d296df3930f8a342a26017cd6521820ff8..6f8d4be6d84fcbf5c1be286c0587ffc0f44cfb26 100644 --- a/site2/website/versioned_docs/version-2.4.0/reference-configuration.md +++ b/site2/website/versioned_docs/version-2.4.0/reference-configuration.md @@ -218,7 +218,6 @@ Pulsar brokers are responsible for handling incoming messages from producers, di |defaultRetentionTimeInMinutes| Default message retention time || |defaultRetentionSizeInMB| Default retention size |0| |keepAliveIntervalSeconds| How often to check whether the connections are still alive |30| -|brokerServicePurgeInactiveFrequencyInSeconds| How often broker checks for inactive topics to be deleted (topics with no subscriptions and no one connected) |60| |loadManagerClassName| Name of load manager to use |org.apache.pulsar.broker.loadbalance.impl.SimpleLoadManagerImpl| |managedLedgerOffloadDriver| Driver to use to offload old data to long term storage (Possible values: S3) || |managedLedgerOffloadMaxThreads| Maximum number of thread pool threads for ledger offloading |2| @@ -392,7 +391,6 @@ The [`pulsar-client`](reference-cli-tools.md#pulsar-client) CLI tool can be used |defaultRetentionTimeInMinutes| |0| |defaultRetentionSizeInMB| |0| |keepAliveIntervalSeconds| |30| -|brokerServicePurgeInactiveFrequencyInSeconds| |60| diff --git a/site2/website/versioned_docs/version-2.4.1/reference-configuration.md b/site2/website/versioned_docs/version-2.4.1/reference-configuration.md index 8a4a62041cf5c8cc0093476623069ed1918fadf8..7fde4565032239b11f607806330468963ed9f084 100644 --- a/site2/website/versioned_docs/version-2.4.1/reference-configuration.md +++ b/site2/website/versioned_docs/version-2.4.1/reference-configuration.md @@ -219,7 +219,6 @@ Pulsar brokers are responsible for handling incoming messages from producers, di |defaultRetentionTimeInMinutes| Default message retention time || |defaultRetentionSizeInMB| Default retention size |0| |keepAliveIntervalSeconds| How often to check whether the connections are still alive |30| -|brokerServicePurgeInactiveFrequencyInSeconds| How often broker checks for inactive topics to be deleted (topics with no subscriptions and no one connected) |60| |loadManagerClassName| Name of load manager to use |org.apache.pulsar.broker.loadbalance.impl.SimpleLoadManagerImpl| |managedLedgerOffloadDriver| Driver to use to offload old data to long term storage (Possible values: S3) || |managedLedgerOffloadMaxThreads| Maximum number of thread pool threads for ledger offloading |2| @@ -393,7 +392,6 @@ The [`pulsar-client`](reference-cli-tools.md#pulsar-client) CLI tool can be used |defaultRetentionTimeInMinutes| |0| |defaultRetentionSizeInMB| |0| |keepAliveIntervalSeconds| |30| -|brokerServicePurgeInactiveFrequencyInSeconds| |60|