You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2017/02/02 08:29:38 UTC

[2/2] lucene-solr:branch_6x: SOLR-7955: Auto create .system collection on first request if it does not exist

SOLR-7955: Auto create .system collection on first request if it does not exist


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/afae0d97
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/afae0d97
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/afae0d97

Branch: refs/heads/branch_6x
Commit: afae0d971867216d1f02a96395ba939a37c8d86e
Parents: ec778c5
Author: Noble Paul <no...@apache.org>
Authored: Thu Feb 2 18:59:23 2017 +1030
Committer: Noble Paul <no...@apache.org>
Committed: Thu Feb 2 18:59:23 2017 +1030

----------------------------------------------------------------------
 .../core/src/java/org/apache/solr/servlet/HttpSolrCall.java | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/afae0d97/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
----------------------------------------------------------------------
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 bbe9074..75b4e68 100644
--- a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
+++ b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
@@ -295,7 +295,7 @@ public class HttpSolrCall {
       extractRemotePath(corename, origCorename, idx);
       if (action != null) return;
       //core is not available locally or remotely
-      autoCreateSystemColl();
+      autoCreateSystemColl(corename);
       if(action != null) return;
     }
 
@@ -332,8 +332,11 @@ public class HttpSolrCall {
     action = PASSTHROUGH;
   }
 
-  protected void autoCreateSystemColl() throws Exception {
-    if (SYSTEM_COLL.equals(corename) && "POST".equals(req.getMethod()) && !cores.getZkController().getClusterState().hasCollection(SYSTEM_COLL)) {
+  protected void autoCreateSystemColl(String corename) throws Exception {
+    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()));