This is an automated email from the ASF dual-hosted git repository.
penghui pushed a commit to branch branch-2.10
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-2.10 by this push:
new 9711525 PIP-118: reconnect broker when ZooKeeper session expires
(#13341)
9711525 is described below
commit 9711525e186577e65c925af0be838bfa3a3251df
Author: Qiang Huang <[email protected]>
AuthorDate: Thu Feb 17 17:51:15 2022 +0800
PIP-118: reconnect broker when ZooKeeper session expires (#13341)
(cherry picked from commit 66bfa78617a33da3be541944b9e9eb64113d493f)
---
conf/broker.conf | 3 +--
deployment/terraform-ansible/templates/broker.conf | 3 +--
.../src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java | 2 +-
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/conf/broker.conf b/conf/broker.conf
index e356420..bbfd03f 100644
--- a/conf/broker.conf
+++ b/conf/broker.conf
@@ -555,8 +555,7 @@ maxNumPartitionsPerPartitionedTopic=0
# There are two policies to apply when broker metadata session expires:
session expired happens, "shutdown" or "reconnect".
# With "shutdown", the broker will be restarted.
# With "reconnect", the broker will keep serving the topics, while attempting
to recreate a new session.
-# Node: the "reconnect" policy is an experiment feature
-zookeeperSessionExpiredPolicy=shutdown
+zookeeperSessionExpiredPolicy=reconnect
# Enable or disable system topic
systemTopicEnabled=false
diff --git a/deployment/terraform-ansible/templates/broker.conf
b/deployment/terraform-ansible/templates/broker.conf
index 710e218..e0957fd 100644
--- a/deployment/terraform-ansible/templates/broker.conf
+++ b/deployment/terraform-ansible/templates/broker.conf
@@ -424,8 +424,7 @@ maxNumPartitionsPerPartitionedTopic=0
# There are two policies when zookeeper session expired happens, "shutdown"
and "reconnect".
# If uses "shutdown" policy, shutdown the broker when zookeeper session
expired happens.
# If uses "reconnect" policy, try to reconnect to zookeeper server and
re-register metadata to zookeeper.
-# Node: the "reconnect" policy is an experiment feature
-zookeeperSessionExpiredPolicy=shutdown
+zookeeperSessionExpiredPolicy=reconnect
# Enable or disable system topic
systemTopicEnabled=false
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 a622d38..6456707 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
@@ -1176,7 +1176,7 @@ public class ServiceConfiguration implements
PulsarConfiguration {
+ " With \"shutdown\", the broker will be restarted.\n\n"
+ " With \"reconnect\", the broker will keep serving the topics, while
attempting to recreate a new session."
)
- private MetadataSessionExpiredPolicy zookeeperSessionExpiredPolicy =
MetadataSessionExpiredPolicy.shutdown;
+ private MetadataSessionExpiredPolicy zookeeperSessionExpiredPolicy =
MetadataSessionExpiredPolicy.reconnect;
@FieldContext(
category = CATEGORY_SERVER,