From c1e7967192f47ad384f774319c29d4a150851e6f Mon Sep 17 00:00:00 2001 From: Ikhun Um Date: Mon, 10 Jul 2023 21:32:01 +0900 Subject: [PATCH] Disable Zookeeper multi address Motivation: Zookeeper 3.6 added a new option that was ability to set mulitple addersss for quorum operations. https://github.com/apache/zookeeper/pull/1048 The multiaddres was not compatible with the old protocol used in ZooKeeper 3.5.x, so the option has been disabled by https://github.com/apache/zookeeper/pull/1251. In https://github.com/apache/zookeeper/pull/1251, the default value of `QuorumPeer.multiAddressEnabled` was changed. https://github.com/apache/zookeeper/blob/e08cc2a782982964a57651f179a468b19e2e6010/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumPeer.java#L174-L180 Since CentralDogma directly extends `QuorumPeer`, `zookeeper.multiadress` is activated automatically and Central Dogma using Zookeeper 3.5.x can't be upgraded with rolling deployment. Modifications: - Set `multiAddressEnabled` to false when creating `EmbeddedZooKeeper` Result: - Fixed an issue where CentralDogma does not perform rolling updates due to Zookeeper invalid protocol version. - Note that this bug affects 0.61.2, 0.61.3 and 0.61.4 --- .../server/internal/replication/EmbeddedZooKeeper.java | 1 + 1 file changed, 1 insertion(+) diff --git a/server/src/main/java/com/linecorp/centraldogma/server/internal/replication/EmbeddedZooKeeper.java b/server/src/main/java/com/linecorp/centraldogma/server/internal/replication/EmbeddedZooKeeper.java index 1c57bd9374..1936ef7a76 100644 --- a/server/src/main/java/com/linecorp/centraldogma/server/internal/replication/EmbeddedZooKeeper.java +++ b/server/src/main/java/com/linecorp/centraldogma/server/internal/replication/EmbeddedZooKeeper.java @@ -78,6 +78,7 @@ final class EmbeddedZooKeeper extends QuorumPeer { setLearnerType(zkCfg.getPeerType()); setSyncEnabled(zkCfg.getSyncEnabled()); setQuorumListenOnAllIPs(zkCfg.getQuorumListenOnAllIPs()); + setMultiAddressEnabled(false); configureSasl();