Apache Lucene open-source search software
SOLR-11702: Remove old LIR call in SolrCmdDistributor and let DistributedUpdateProcessor handle it on finish()
Cao Manh Datf1ce5419eebf
diff --git a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.javaindex b200f892f6f..08b397fbb20 100644--- a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java+++ b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java@@ -278,24 +278,14 @@ public class SolrCmdDistributor implements Closeable {try (HttpSolrClient client = new HttpSolrClient.Builder(req.node.getUrl()).withHttpClient(clients.getHttpClient()).build()) {client.request(req.uReq);} catch (Exception e) {- try {- // if false, then the node is probably not "live" anymore- // and we do not need to send a recovery message- Throwable rootCause = SolrException.getRootCause(e);- log.error("Setting up to try to start recovery on replica {}", req.node.getUrl(), rootCause);- req.cmd.getReq().getCore().getCoreContainer().getZkController().ensureReplicaInLeaderInitiatedRecovery(- req.cmd.getReq().getCore().getCoreContainer(),- req.node.getCollection(),- req.node.getShardId(),- req.node.getNodeProps(),- req.cmd.getReq().getCore().getCoreDescriptor(),- false /* forcePublishState */- );- } catch (Exception exc) {- Throwable setLirZnodeFailedCause = SolrException.getRootCause(exc);- log.error("Leader failed to set replica " +- req.node.getUrl() + " state to DOWN due to: " + setLirZnodeFailedCause, setLirZnodeFailedCause);+ SolrException.log(log, e);+ Error error = new Error();+ error.e = e;+ error.req = req;+ if (e instanceof SolrException) {+ error.statusCode = ((SolrException) e).code();}+ errors.add(error);}return;diff --git a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.javaindex 3cff1719782..b37cb9c915f 100644--- a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java+++ b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java@@ -882,6 +882,8 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {log.warn("Core "+cloudDesc.getCoreNodeName()+" belonging to "+collection+" "+shardId+", does not have error'd node " + stdNode.getNodeProps().getCoreUrl() + " as a replica. " +"No request recovery command will be sent!");+ // some replicas did not receive the updates, exception must be notified to clients+ errorsForClient.add(error);} else {log.warn("Core " + cloudDesc.getCoreNodeName() + " is no longer the leader for " + collection + " "+ shardId + " or we tried to put ourself into LIR, no request recovery command will be sent!");