You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/04/28 16:28:36 UTC
[GitHub] [solr] madrob commented on a diff in pull request #825: SOLR-16164: check if the configset ZK node actually has metadata or not
madrob commented on code in PR #825:
URL: https://github.com/apache/solr/pull/825#discussion_r861093521
##########
solr/core/src/java/org/apache/solr/cloud/ZkConfigSetService.java:
##########
@@ -233,10 +233,14 @@ public void setConfigMetadata(String configName, Map<String, Object> data) throw
@Override
public Map<String, Object> getConfigMetadata(String configName) throws IOException {
try {
+
+ byte[] bytedata = zkClient.getData(CONFIGS_ZKNODE + "/" + configName, null, null, true);
+ if (bytedata == null) return new HashMap<>();
+
@SuppressWarnings("unchecked")
Map<String, Object> data =
(Map<String, Object>)
- Utils.fromJSON(zkClient.getData(CONFIGS_ZKNODE + "/" + configName, null, null, true));
+ Utils.fromJSON(bytedata);
Review Comment:
Maybe this should instead make `Utils.fromJSON` to be more lenient and allow `null array->empty map`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org