janhoy commented on code in PR #1321: URL: https://github.com/apache/solr/pull/1321#discussion_r1093285558
########## solr/bin/solr.in.sh: ########## @@ -83,6 +83,12 @@ # By default Solr will try to connect to Zookeeper with 30 seconds in timeout; override the timeout if needed #SOLR_WAIT_FOR_ZK="30" +# By default Solr will delete cores that are not registered in Zookeeper at startup; +# set to "true" to disable that behavior and preserve unknown cores so that you can +# delete them manually. This may protect against misconfiguration (e.g. connecting +# to the wrong Zookeeper instance or chroot). +#SOLR_PRESERVE_UNKNOWN_CORES="true" Review Comment: We normally use the default value as the commented-out value in solr.in.sh, so this would be `false`. ########## solr/core/src/java/org/apache/solr/core/CoreContainer.java: ########## @@ -1655,8 +1655,22 @@ private SolrCore createFromDescriptor( } catch (Exception e) { coreInitFailures.put(dcore.getName(), new CoreLoadFailure(dcore, e)); if (e instanceof ZkController.NotInClusterStateException && !newCollection) { - // this mostly happen when the core is deleted when this node is down - unload(dcore.getName(), true, true, true); + // this mostly happens when the core is deleted when this node is down + // but it can also happen if connecting to the wrong zookeeper + final boolean preserveUnknownCores = Boolean.getBoolean("preserveUnknownCores"); Review Comment: Can we perhaps prefix all sysprops with `solr.` since many other libraries may also read system properties, and sooner or later there will be a name clash. -- 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-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org