mirror of https://github.com/apache/lucene.git
SOLR-6530: Protect against NPE when there are no live replicas
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1633276 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c1bdf27d97
commit
58fe66dba7
|
@ -850,12 +850,14 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
|
||||||
List<ZkCoreNodeProps> myReplicas = zkController.getZkStateReader().getReplicaProps(collection,
|
List<ZkCoreNodeProps> myReplicas = zkController.getZkStateReader().getReplicaProps(collection,
|
||||||
cloudDesc.getShardId(), cloudDesc.getCoreNodeName());
|
cloudDesc.getShardId(), cloudDesc.getCoreNodeName());
|
||||||
boolean foundErrorNodeInReplicaList = false;
|
boolean foundErrorNodeInReplicaList = false;
|
||||||
|
if (myReplicas != null) {
|
||||||
for (ZkCoreNodeProps replicaProp : myReplicas) {
|
for (ZkCoreNodeProps replicaProp : myReplicas) {
|
||||||
if (((Replica) replicaProp.getNodeProps()).getName().equals(((Replica)stdNode.getNodeProps().getNodeProps()).getName())) {
|
if (((Replica) replicaProp.getNodeProps()).getName().equals(((Replica)stdNode.getNodeProps().getNodeProps()).getName())) {
|
||||||
foundErrorNodeInReplicaList = true;
|
foundErrorNodeInReplicaList = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (cloudDesc.getCoreNodeName().equals(leaderCoreNodeName) && foundErrorNodeInReplicaList) {
|
if (cloudDesc.getCoreNodeName().equals(leaderCoreNodeName) && foundErrorNodeInReplicaList) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue