SOLR-12146: LIR should skip deleted replicas

This commit is contained in:
Cao Manh Dat 2018-03-27 15:55:43 +07:00
parent b3cf209f6f
commit 160faaf594
2 changed files with 6 additions and 4 deletions

View File

@ -96,6 +96,8 @@ Optimizations
* SOLR-11891: DocStreamer now respects the ReturnFields when populating a SolrDocument, reducing the * SOLR-11891: DocStreamer now respects the ReturnFields when populating a SolrDocument, reducing the
number of unneccessary fields a ResponseWriter will see if documentCache is used (wei wang, hossman) number of unneccessary fields a ResponseWriter will see if documentCache is used (wei wang, hossman)
* SOLR-12146: LIR should skip deleted replicas (Cao Manh Dat)
Other Changes Other Changes
---------------------- ----------------------

View File

@ -2175,7 +2175,8 @@ public class ZkController {
} }
// we only really need to try to start the LIR process if the node itself is "live" // we only really need to try to start the LIR process if the node itself is "live"
if (getZkStateReader().getClusterState().liveNodesContain(replicaNodeName)) { if (getZkStateReader().getClusterState().liveNodesContain(replicaNodeName)
&& CloudUtil.replicaExists(getZkStateReader().getClusterState(), collection, shardId, replicaCoreNodeName)) {
LeaderInitiatedRecoveryThread lirThread = LeaderInitiatedRecoveryThread lirThread =
new LeaderInitiatedRecoveryThread(this, new LeaderInitiatedRecoveryThread(this,
@ -2200,9 +2201,8 @@ public class ZkController {
replicaNodeName + " into leader-initiated recovery.", replicaCoreProps.getCoreName(), replicaCoreNodeName); replicaNodeName + " into leader-initiated recovery.", replicaCoreProps.getCoreName(), replicaCoreNodeName);
} else { } else {
nodeIsLive = false; // we really don't need to send the recovery request if the node is NOT live nodeIsLive = false; // we really don't need to send the recovery request if the node is NOT live
log.info("Node " + replicaNodeName + log.info("Node {} is not live or replica {} is deleted, so skipping leader-initiated recovery for replica: core={}",
" is not live, so skipping leader-initiated recovery for replica: core={} coreNodeName={}", replicaNodeName, replicaCoreNodeName, replicaCoreProps.getCoreName());
replicaCoreProps.getCoreName(), replicaCoreNodeName);
// publishDownState will be false to avoid publishing the "down" state too many times // publishDownState will be false to avoid publishing the "down" state too many times
// as many errors can occur together and will each call into this method (SOLR-6189) // as many errors can occur together and will each call into this method (SOLR-6189)
} }