Apache Solr open-source search software
SOLR-17019: ZkCli should create subpaths when necessary (#1998)
Houston Putman3ab168392c07
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex e14e96fdb8f..8d2a4d342e4 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -259,6 +259,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.javaindex 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.javaindex 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) {