You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by da...@apache.org on 2018/03/02 07:29:29 UTC
lucene-solr:master: SOLR-11702: Remove old LIR call in
SolrCmdDistributor and let DistributedUpdateProcessor handle it on finish()
Repository: lucene-solr
Updated Branches:
refs/heads/master 23aee0021 -> f1ce5419e
SOLR-11702: Remove old LIR call in SolrCmdDistributor and let DistributedUpdateProcessor handle it on finish()
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/f1ce5419
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/f1ce5419
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/f1ce5419
Branch: refs/heads/master
Commit: f1ce5419eebfa361f572802eb4a8b637c2849bb5
Parents: 23aee00
Author: Cao Manh Dat <da...@apache.org>
Authored: Fri Mar 2 14:29:18 2018 +0700
Committer: Cao Manh Dat <da...@apache.org>
Committed: Fri Mar 2 14:29:18 2018 +0700
----------------------------------------------------------------------
.../apache/solr/update/SolrCmdDistributor.java | 24 ++++++--------------
.../processor/DistributedUpdateProcessor.java | 2 ++
2 files changed, 9 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1ce5419/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
index b200f89..08b397f 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;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1ce5419/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
----------------------------------------------------------------------
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.java
index 3cff171..b37cb9c 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!");