SOLR-9707: Don't forward DeleteByQuery requests to down replicas

This commit is contained in:
Varun Thacker 2016-12-12 15:28:22 -08:00
parent 39ba13046b
commit fecbbe081f
2 changed files with 5 additions and 5 deletions

View File

@ -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 * SOLR-9834: A variety of spots in the code can create a collection zk node after the collection has been
removed. (Mark Miller) removed. (Mark Miller)
* SOLR-9707: Don't forward DeleteByQuery requests to down replicas. (Jessica Cheng Mallet via Varun Thacker)
Other Changes Other Changes
---------------------- ----------------------

View File

@ -658,8 +658,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
String shardId = cloudDesc.getShardId(); String shardId = cloudDesc.getShardId();
try { try {
Replica leaderReplica = zkController.getZkStateReader().getLeaderRetry( Replica leaderReplica = zkController.getZkStateReader().getLeaderRetry(collection, shardId);
collection, shardId);
isLeader = leaderReplica.getName().equals( isLeader = leaderReplica.getName().equals(
req.getCore().getCoreDescriptor().getCloudDescriptor() req.getCore().getCoreDescriptor().getCloudDescriptor()
.getCoreNodeName()); .getCoreNodeName());
@ -668,7 +667,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
forwardToLeader = false; forwardToLeader = false;
List<ZkCoreNodeProps> replicaProps = zkController.getZkStateReader() List<ZkCoreNodeProps> replicaProps = zkController.getZkStateReader()
.getReplicaProps(collection, shardId, leaderReplica.getName()); .getReplicaProps(collection, shardId, leaderReplica.getName(), null, Replica.State.DOWN);
if (replicaProps != null) { if (replicaProps != null) {
nodes = new ArrayList<>(replicaProps.size()); nodes = new ArrayList<>(replicaProps.size());
for (ZkCoreNodeProps props : replicaProps) { for (ZkCoreNodeProps props : replicaProps) {
@ -677,8 +676,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
} }
} catch (InterruptedException e) { } catch (InterruptedException e) {
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, "", throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, "", e);
e);
} }
return nodes; return nodes;