You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by is...@apache.org on 2018/02/10 16:09:45 UTC
lucene-solr:branch_7x: SOLR-10261: Failure in replica didn't cause
LIR; now it does
Repository: lucene-solr
Updated Branches:
refs/heads/branch_7x c06f56051 -> 5dd5a5aae
SOLR-10261: Failure in replica didn't cause LIR; now it does
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/5dd5a5aa
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5dd5a5aa
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5dd5a5aa
Branch: refs/heads/branch_7x
Commit: 5dd5a5aae2b926eac4452ce55d4f20886381aee6
Parents: c06f560
Author: Ishan Chattopadhyaya <is...@apache.org>
Authored: Sat Feb 10 21:38:54 2018 +0530
Committer: Ishan Chattopadhyaya <is...@apache.org>
Committed: Sat Feb 10 21:39:30 2018 +0530
----------------------------------------------------------------------
solr/CHANGES.txt | 3 +++
.../apache/solr/update/SolrCmdDistributor.java | 20 ++++++++++++++++++--
2 files changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5dd5a5aa/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index d6dda28..f68a290 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -177,6 +177,9 @@ Bug Fixes
* SOLR-11931: Fix contrib/ltr custom inner class feature/normaliser/model persistence. (Christine Poerschke)
+* SOLR-10261: In case of in-place updates, failure in leader to follower replica update request now throws the
+ follower replica in leader-initiated-recovery (Ishan Chattopadhyaya, Steve Rowe)
+
Optimizations
----------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5dd5a5aa/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 1851f3d..b200f89 100644
--- a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
+++ b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
@@ -26,7 +26,6 @@ import org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient; // jdoc
import org.apache.solr.client.solrj.request.AbstractUpdateRequest;
import org.apache.solr.client.solrj.request.UpdateRequest;
import org.apache.solr.common.SolrException;
-import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.solr.common.cloud.ZkCoreNodeProps;
import org.apache.solr.common.cloud.ZkStateReader;
import org.apache.solr.common.params.ModifiableSolrParams;
@@ -279,7 +278,24 @@ 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) {
- throw new SolrException(ErrorCode.SERVER_ERROR, "Failed synchronous update on shard " + req.node + " update: " + req.uReq , 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);
+ }
}
return;