Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-4602: ZkController#unregister should cancel it's election participation before asking the Overseer to delete the SolrCore information.

Mark Robert Miller720ded1e468b
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 2f6927b40ac..36565e4df2d 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -153,6 +153,9 @@ Bug Fixes
* SOLR-4599: CachingDirectoryFactory calls close(Directory) on forceNew if the
Directory has a refCnt of 0, but it should call closeDirectory(CacheValue).
(Mark Miller)
+
+* SOLR-4602: ZkController#unregister should cancel it's election participation
+ before asking the Overseer to delete the SolrCore information. (Mark Miller)
Optimizations
----------------------
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 2592e35d5ee..97bf0d2e800 100644
--- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java
+++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java
@@ -1021,17 +1021,17 @@ public final class ZkController {
public void unregister(String coreName, CoreDescriptor cd)
throws InterruptedException, KeeperException {
- ZkNodeProps m = new ZkNodeProps(Overseer.QUEUE_OPERATION,
- "deletecore", ZkStateReader.CORE_NAME_PROP, coreName,
- ZkStateReader.NODE_NAME_PROP, getNodeName(),
- ZkStateReader.COLLECTION_PROP, cd.getCloudDescriptor().getCollectionName());
- overseerJobQueue.offer(ZkStateReader.toJSON(m));
-
final String zkNodeName = getCoreNodeName(cd);
ElectionContext context = electionContexts.remove(zkNodeName);
if (context != null) {
context.cancelElection();
}
+
+ ZkNodeProps m = new ZkNodeProps(Overseer.QUEUE_OPERATION,
+ "deletecore", ZkStateReader.CORE_NAME_PROP, coreName,
+ ZkStateReader.NODE_NAME_PROP, getNodeName(),
+ ZkStateReader.COLLECTION_PROP, cd.getCloudDescriptor().getCollectionName());
+ overseerJobQueue.offer(ZkStateReader.toJSON(m));
}
public void createCollection(String collection) throws KeeperException,