Skip to content

Commit

Permalink
reconnect broker when ZooKeeper session expires
Browse files Browse the repository at this point in the history
  • Loading branch information
HQebupt committed Dec 17, 2021
1 parent 703712e commit 6291089
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions conf/broker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,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
Expand Down
3 changes: 1 addition & 2 deletions deployment/terraform-ansible/templates/broker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,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,
Expand Down

0 comments on commit 6291089

Please sign in to comment.