lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject [lucene-solr] branch reference_impl updated: @753 Move this back to register.
Date Sun, 06 Sep 2020 01:55:54 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/reference_impl by this push:
     new 8b3c658  @753 Move this back to register.
8b3c658 is described below

commit 8b3c6583a5ae178bfb06b591a34833c785245c5f
Author: markrmiller@gmail.com <markrmiller@gmail.com>
AuthorDate: Sat Sep 5 20:55:39 2020 -0500

    @753 Move this back to register.
---
 solr/core/src/java/org/apache/solr/cloud/ZkController.java | 8 ++++++++
 solr/core/src/java/org/apache/solr/core/SolrCore.java      | 6 ------
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkController.java b/solr/core/src/java/org/apache/solr/cloud/ZkController.java
index f619f01..8303f60 100644
--- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java
+++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java
@@ -1483,6 +1483,14 @@ public class ZkController implements Closeable {
       final String coreZkNodeName = cloudDesc.getCoreNodeName();
       assert coreZkNodeName != null : "we should have a coreNodeName by now";
       log.info("Register SolrCore, baseUrl={} collection={}, shard={} coreNodeName={}", baseUrl,
collection, shardId, coreZkNodeName);
+
+      // make sure we don't stop watching our own collection after a collection delete ->
create
+
+      // the watcher is added to a set so multiple calls of this method will left only one
watcher
+      getZkStateReader().registerCore(cloudDesc.getCollectionName());
+      // the watcher is added to a set so multiple calls of this method will left only one
watcher
+      registerUnloadWatcher(cloudDesc.getCollectionName(), cloudDesc.getShardId(), cloudDesc.getCoreNodeName(),
desc.getName());
+
       // check replica's existence in clusterstate first
       try {
         zkStateReader.waitForState(collection, Overseer.isLegacy(zkStateReader) ? 10000 :
10000,
diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.java
index 291a5af..e05c4e6 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrCore.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java
@@ -1083,12 +1083,6 @@ public final class SolrCore implements SolrInfoBean, Closeable {
       if (coreContainer.isZooKeeperAware()) {
         // make sure we see our shard first - these tries to cover a surprising race where
we don't find our shard in the clusterstate
         // in the below bufferUpdatesIfConstructing call
-        // make sure we don't stop watching our own collection after a collection delete
-> create
-        CloudDescriptor cloudDesc = coreDescriptor.getCloudDescriptor();
-        // the watcher is added to a set so multiple calls of this method will left only
one watcher
-        coreContainer.getZkController().getZkStateReader().registerCore(cloudDesc.getCollectionName());
-        // the watcher is added to a set so multiple calls of this method will left only
one watcher
-        coreContainer.getZkController().registerUnloadWatcher(cloudDesc.getCollectionName(),
cloudDesc.getShardId(), cloudDesc.getCoreNodeName(), cd.getName());
 
         coreContainer.getZkController().getZkStateReader().waitForState(coreDescriptor.getCollectionName(),
             5, TimeUnit.SECONDS, (l,c) -> c != null && c.getSlice(coreDescriptor.getCloudDescriptor().getShardId())
!= null);


Mime
View raw message