This is an automated email from the ASF dual-hosted git repository.
houston pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new 3ab168392c0 SOLR-17019: ZkCli should create subpaths when necessary
(#1998)
3ab168392c0 is described below
commit 3ab168392c074748ef09396c768bbb3eeac074a8
Author: Houston Putman <[email protected]>
AuthorDate: Tue Oct 10 21:17:22 2023 -0400
SOLR-17019: ZkCli should create subpaths when necessary (#1998)
---
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 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.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) {