You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2018/08/01 09:56:45 UTC

lucene-solr:jira/solr-12607: SOLR-12607: Set the correct sub-shard name for StdNode instead of parent shard name

Repository: lucene-solr
Updated Branches:
  refs/heads/jira/solr-12607 5228de9e1 -> 05b6ba449


SOLR-12607: Set the correct sub-shard name for StdNode instead of parent shard name

The DistributedUpdateProcessor's doFinish() method relies on the failing node's shard name to decide whether to return an exception to the client or to continue. During shard split, we forward updates synchronously to sub shard leaders and we'd like to return exceptions to clients so that they can retry. However, due to using the parent shard name in the StdNode, the comparison between the current replica's shard and StdNode's shard always passed and the errors were never returned.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/05b6ba44
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/05b6ba44
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/05b6ba44

Branch: refs/heads/jira/solr-12607
Commit: 05b6ba4493d31d1eb26c421cccaf511b7e35203c
Parents: 5228de9
Author: Shalin Shekhar Mangar <sh...@apache.org>
Authored: Wed Aug 1 15:26:37 2018 +0530
Committer: Shalin Shekhar Mangar <sh...@apache.org>
Committed: Wed Aug 1 15:26:37 2018 +0530

----------------------------------------------------------------------
 .../apache/solr/update/processor/DistributedUpdateProcessor.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/05b6ba44/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 da6849f..76e9cda 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
@@ -432,13 +432,13 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
         boolean isSubset = aslice.getRange() != null && aslice.getRange().isSubsetOf(myRange);
         if (isSubset &&
             (docId == null // in case of deletes
-            || (docId != null && coll.getRouter().isTargetSlice(docId, doc, req.getParams(), aslice.getName(), coll)))) {
+            || coll.getRouter().isTargetSlice(docId, doc, req.getParams(), aslice.getName(), coll))) {
           Replica sliceLeader = aslice.getLeader();
           // slice leader can be null because node/shard is created zk before leader election
           if (sliceLeader != null && zkController.getClusterState().liveNodesContain(sliceLeader.getNodeName()))  {
             if (nodes == null) nodes = new ArrayList<>();
             ZkCoreNodeProps nodeProps = new ZkCoreNodeProps(sliceLeader);
-            nodes.add(new StdNode(nodeProps, coll.getName(), shardId));
+            nodes.add(new StdNode(nodeProps, coll.getName(), aslice.getName()));
           }
         }
       }