From fecbbe081fd4a777f01517fdd8631e69797def38 Mon Sep 17 00:00:00 2001 From: Varun Thacker Date: Mon, 12 Dec 2016 15:28:22 -0800 Subject: [PATCH] SOLR-9707: Don't forward DeleteByQuery requests to down replicas --- solr/CHANGES.txt | 2 ++ .../solr/update/processor/DistributedUpdateProcessor.java | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 37cccaea5db..a8a3f971023 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -240,6 +240,8 @@ Bug Fixes * SOLR-9834: A variety of spots in the code can create a collection zk node after the collection has been removed. (Mark Miller) +* SOLR-9707: Don't forward DeleteByQuery requests to down replicas. (Jessica Cheng Mallet via Varun Thacker) + Other Changes ---------------------- 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 b8bdd16cfb4..c62a90af260 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 @@ -658,8 +658,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor { String shardId = cloudDesc.getShardId(); try { - Replica leaderReplica = zkController.getZkStateReader().getLeaderRetry( - collection, shardId); + Replica leaderReplica = zkController.getZkStateReader().getLeaderRetry(collection, shardId); isLeader = leaderReplica.getName().equals( req.getCore().getCoreDescriptor().getCloudDescriptor() .getCoreNodeName()); @@ -668,7 +667,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor { forwardToLeader = false; List replicaProps = zkController.getZkStateReader() - .getReplicaProps(collection, shardId, leaderReplica.getName()); + .getReplicaProps(collection, shardId, leaderReplica.getName(), null, Replica.State.DOWN); if (replicaProps != null) { nodes = new ArrayList<>(replicaProps.size()); for (ZkCoreNodeProps props : replicaProps) { @@ -677,8 +676,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor { } } catch (InterruptedException e) { Thread.currentThread().interrupt(); - throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, "", - e); + throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, "", e); } return nodes;