You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by is...@apache.org on 2021/02/16 16:06:33 UTC

[lucene-solr] 02/02: SOLR-15138: Send an intra-process message after ZkClient#create() call

This is an automated email from the ASF dual-hosted git repository.

ishan pushed a commit to branch branch_8_8
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit b31c117987a33cd2de9daa9f6b0d35035d11ec85
Author: Ishan Chattopadhyaya <is...@apache.org>
AuthorDate: Mon Feb 15 12:14:57 2021 +0530

    SOLR-15138: Send an intra-process message after ZkClient#create() call
---
 .../solr/cloud/api/collections/CreateCollectionCmd.java       | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateCollectionCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateCollectionCmd.java
index 6d9e67e..957d272 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateCollectionCmd.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateCollectionCmd.java
@@ -188,6 +188,7 @@ public class CreateCollectionCmd implements OverseerCollectionMessageHandler.Cmd
         ocmh.zkStateReader.getZkClient().create(collectionPath, data, CreateMode.PERSISTENT, true);
         clusterState = clusterState.copyWith(collectionName, command.collection);
         newColl = command.collection;
+        ocmh.overseer.submit(new RefreshCollectionMessage(collectionName));
       } else {
         ocmh.overseer.offerStateUpdate(Utils.toJSON(message));
 
@@ -319,6 +320,9 @@ public class CreateCollectionCmd implements OverseerCollectionMessageHandler.Cmd
           coresToCreate.put(coreName, sreq);
         }
       }
+      if(isPRS) {
+        ocmh.overseer.submit(new RefreshCollectionMessage(collectionName));
+      }
 
       if(!isLegacyCloud) {
         // wait for all replica entries to be created
@@ -350,11 +354,10 @@ public class CreateCollectionCmd implements OverseerCollectionMessageHandler.Cmd
           Thread.sleep(100);
           prs = PerReplicaStates.fetch(collectionPath, ocmh.zkStateReader.getZkClient(), null);
         }
-        if (prs.allActive()) {
-          // we have successfully found all replicas to be ACTIVE
-        } else {
+        if (!prs.allActive()) {
           failure = true;
-        }
+        }  // we have successfully found all replicas to be ACTIVE
+
         // Now ask Overseer to fetch the latest state of collection
         // from ZK
         ocmh.overseer.submit(new RefreshCollectionMessage(collectionName));