This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 884c32e3a52 SOLR-17019: ZkCli should create subpaths when necessary 
(#1998)
884c32e3a52 is described below

commit 884c32e3a52db9673eadb7f9d4f26bd03610e493
Author: Houston Putman <[email protected]>
AuthorDate: Tue Oct 10 21:17:22 2023 -0400

    SOLR-17019: ZkCli should create subpaths when necessary (#1998)
    
    (cherry picked from commit 3ab168392c074748ef09396c768bbb3eeac074a8)
---
 solr/CHANGES.txt                                                      | 2 ++
 solr/core/src/java/org/apache/solr/cloud/ZkCLI.java                   | 4 ++--
 .../src/java/org/apache/solr/common/cloud/ClusterProperties.java      | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 33120f5dba6..32efe0affbb 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -199,6 +199,8 @@ Bug Fixes
 
 * SOLR-17009: json.wrf parameter ignored in JacksonJsonWriter (Alex Deparvu)
 
+* SOLR-17019: ZkCli should create subpaths when necessary (Houston Putman)
+
 Dependency Upgrades
 ---------------------
 
diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkCLI.java 
b/solr/core/src/java/org/apache/solr/cloud/ZkCLI.java
index 07c66805068..8e058a32a9a 100644
--- a/solr/core/src/java/org/apache/solr/cloud/ZkCLI.java
+++ b/solr/core/src/java/org/apache/solr/cloud/ZkCLI.java
@@ -415,7 +415,7 @@ public class ZkCLI implements CLIO {
           if (zkClient.exists(path, true)) {
             zkClient.setData(path, data, true);
           } else {
-            zkClient.create(path, data, CreateMode.PERSISTENT, true);
+            zkClient.makePath(path, data, CreateMode.PERSISTENT, true);
           }
         } else if (line.getOptionValue(CMD).equalsIgnoreCase(PUT_FILE)) {
           List<String> arglist = line.getArgList();
@@ -436,7 +436,7 @@ public class ZkCLI implements CLIO {
           if (zkClient.exists(path, true)) {
             zkClient.setData(path, data, true);
           } else {
-            zkClient.create(path, data, CreateMode.PERSISTENT, true);
+            zkClient.makePath(path, data, CreateMode.PERSISTENT, true);
           }
         } else if (line.getOptionValue(CMD).equalsIgnoreCase(GET)) {
           List<String> arglist = line.getArgList();
diff --git 
a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ClusterProperties.java
 
b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ClusterProperties.java
index 64264ddadc5..84e5cf462e4 100644
--- 
a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ClusterProperties.java
+++ 
b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ClusterProperties.java
@@ -220,7 +220,7 @@ public class ClusterProperties {
           @SuppressWarnings({"rawtypes"})
           Map properties = new LinkedHashMap();
           properties.put(propertyName, propertyValue);
-          client.create(
+          client.makePath(
               ZkStateReader.CLUSTER_PROPS, Utils.toJSON(properties), 
CreateMode.PERSISTENT, true);
         }
       } catch (KeeperException.BadVersionException | 
KeeperException.NodeExistsException e) {

Reply via email to