Skip to content

Apache Lucene open-source search software

SOLR-7955: further optimization to avoid zk lookup

Noble Paulff1a9e923530
diff --git a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
index ef0eb13329b..4f6bae0aead 100644
--- a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
+++ b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
@@ -341,7 +341,10 @@ public class HttpSolrCall {
}
protected void autoCreateSystemColl(String corename) throws Exception {
- if (SYSTEM_COLL.equals(corename) && "POST".equals(req.getMethod()) && !cores.getZkController().getClusterState().hasCollection(SYSTEM_COLL)) {
+ if (core == null &&
+ SYSTEM_COLL.equals(corename) &&
+ "POST".equals(req.getMethod()) &&
+ !cores.getZkController().getClusterState().hasCollection(SYSTEM_COLL)) {
log.info("Going to auto-create .system collection");
SolrQueryResponse rsp = new SolrQueryResponse();
String repFactor = String.valueOf(Math.min(3, cores.getZkController().getClusterState().getLiveNodes().size()));