From 66bfa78617a33da3be541944b9e9eb64113d493f Mon Sep 17 00:00:00 2001 From: Qiang Huang Date: Thu, 17 Feb 2022 17:51:15 +0800 Subject: [PATCH] PIP-118: reconnect broker when ZooKeeper session expires (#13341) --- conf/broker.conf | 3 +-- deployment/terraform-ansible/templates/broker.conf | 3 +-- .../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 e35642006a39c..bbfd03f95ca83 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 710e218d08c10..e0957fd66d2f2 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 a622d38d16994..6456707d9ff93 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,