This is an automated email from the ASF dual-hosted git repository. swuferhong pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/fluss.git
commit cf180274ccd606398bd1841b12f6e4c9be454780 Author: yunhong <[email protected]> AuthorDate: Fri Jul 3 10:55:54 2026 +0800 [server] Apply ZooKeeper max buffer size without config path --- .../org/apache/fluss/server/zk/ZooKeeperUtils.java | 2 +- .../apache/fluss/server/zk/ZooKeeperClientTest.java | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/fluss-server/src/main/java/org/apache/fluss/server/zk/ZooKeeperUtils.java b/fluss-server/src/main/java/org/apache/fluss/server/zk/ZooKeeperUtils.java index 61336ef8f..4fffd5d06 100644 --- a/fluss-server/src/main/java/org/apache/fluss/server/zk/ZooKeeperUtils.java +++ b/fluss-server/src/main/java/org/apache/fluss/server/zk/ZooKeeperUtils.java @@ -111,7 +111,6 @@ public class ZooKeeperUtils { if (configPath.isPresent()) { try { zkClientConfig = new ZKClientConfig(configPath.get()); - curatorFrameworkBuilder.zkClientConfig(zkClientConfig); } catch (QuorumPeerConfig.ConfigException e) { LOG.warn("Fail to load zookeeper client config from path {}", configPath.get(), e); throw new RuntimeException( @@ -127,6 +126,7 @@ public class ZooKeeperUtils { zkClientConfig.setProperty( JUTE_MAXBUFFER, String.valueOf(configuration.getInt(ConfigOptions.ZOOKEEPER_MAX_BUFFER_SIZE))); + curatorFrameworkBuilder.zkClientConfig(zkClientConfig); return new ZooKeeperClient( startZookeeperClient(curatorFrameworkBuilder, fatalErrorHandler), configuration); diff --git a/fluss-server/src/test/java/org/apache/fluss/server/zk/ZooKeeperClientTest.java b/fluss-server/src/test/java/org/apache/fluss/server/zk/ZooKeeperClientTest.java index a94cf8e0d..ea753c885 100644 --- a/fluss-server/src/test/java/org/apache/fluss/server/zk/ZooKeeperClientTest.java +++ b/fluss-server/src/test/java/org/apache/fluss/server/zk/ZooKeeperClientTest.java @@ -74,6 +74,7 @@ import java.util.stream.Collectors; import static org.apache.fluss.cluster.rebalance.RebalanceStatus.COMPLETED; import static org.apache.fluss.cluster.rebalance.RebalanceStatus.NOT_STARTED; import static org.apache.fluss.server.utils.TableAssignmentUtils.generateAssignment; +import static org.apache.fluss.shaded.zookeeper3.org.apache.zookeeper.common.ZKConfig.JUTE_MAXBUFFER; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -742,6 +743,25 @@ class ZooKeeperClientTest { } } + @Test + void testZookeeperMaxBufferSizeWithoutConfigPath() throws Exception { + final Configuration config = new Configuration(); + config.setString( + ConfigOptions.ZOOKEEPER_ADDRESS, + ZOO_KEEPER_EXTENSION_WRAPPER.getCustomExtension().getConnectString()); + config.set(ConfigOptions.REMOTE_DATA_DIR, remoteDataDir); + config.set(ConfigOptions.ZOOKEEPER_MAX_BUFFER_SIZE, 2 * 1024 * 1024); + + try (ZooKeeperClient zookeeperClient = + ZooKeeperUtils.startZookeeperClient(config, NOPErrorHandler.INSTANCE); + CuratorFramework curatorClient = zookeeperClient.getCuratorClient(); + CuratorZookeeperClient curatorZookeeperClient = curatorClient.getZookeeperClient(); + ZooKeeper zooKeeper = curatorZookeeperClient.getZooKeeper()) { + ZKClientConfig clientConfig = zooKeeper.getClientConfig(); + assertThat(clientConfig.getProperty(JUTE_MAXBUFFER)).isEqualTo("2097152"); + } + } + @Test void testGetDatabaseSummary() throws Exception { TablePath tablePath1 = TablePath.of("db", "tb1");
