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

This commit is contained in:
Varun Thacker 2016-08-13 16:52:47 +05:30
parent 70d27aec83
commit 1d9be84cb6
2 changed files with 12 additions and 4 deletions

View File

@ -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.

View File

@ -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));
boolean isLive = zkStateReader.getClusterState().getLiveNodes().contains(replica.getNodeName());
if (isLive) {
sendShardRequest(replica.getNodeName(), params, shardHandler, asyncId, requestMap.get());
}
Callable<Boolean> callable = () -> {
try {
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;
}
// try and ensure core info is removed from cluster state
deleteCoreNode(collectionName, replicaName, replica, core);