Skip to content

Apache Lucene open-source search software

SOLR-9092: In the deletereplica commandand add a live check before calling delete core

Varun Thacker1d9be84cb67e
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 5d4e2a64bf7..eddb7fba206 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -267,6 +267,9 @@ Other Changes
* SOLR-9331: Remove ReRankQuery's length constructor argument and member. (Christine Poerschke)
+* SOLR-9092: For the delete replica command we attempt to send the core admin delete request only
+ if that node is actually up. (Jessica Cheng Mallet, Varun Thacker)
+
================== 6.1.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
diff --git a/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionMessageHandler.java b/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionMessageHandler.java
index 0588446c653..49e094284b3 100644
--- a/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionMessageHandler.java
+++ b/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionMessageHandler.java
@@ -662,14 +662,19 @@ public class OverseerCollectionMessageHandler implements OverseerMessageHandler
params.set(CoreAdminParams.DELETE_INSTANCE_DIR, message.getBool(CoreAdminParams.DELETE_INSTANCE_DIR, true));
params.set(CoreAdminParams.DELETE_DATA_DIR, message.getBool(CoreAdminParams.DELETE_DATA_DIR, true));
- sendShardRequest(replica.getNodeName(), params, shardHandler, asyncId, requestMap.get());
+ boolean isLive = zkStateReader.getClusterState().getLiveNodes().contains(replica.getNodeName());
+ if (isLive) {
+ sendShardRequest(replica.getNodeName(), params, shardHandler, asyncId, requestMap.get());
+ }
Callable<Boolean> callable = () -> {
try {
- processResponses(results, shardHandler, false, null, asyncId, requestMap.get());
+ if (isLive) {
+ processResponses(results, shardHandler, false, null, asyncId, requestMap.get());
- //check if the core unload removed the corenode zk entry
- if (waitForCoreNodeGone(collectionName, shard, replicaName, 5000)) return Boolean.TRUE;
+ //check if the core unload removed the corenode zk entry
+ if (waitForCoreNodeGone(collectionName, shard, replicaName, 5000)) return Boolean.TRUE;
+ }
// try and ensure core info is removed from cluster state
deleteCoreNode(collectionName, replicaName, replica, core);