SOLR-4067: ZkStateReader#getLeaderProps should not return props for a leader that it does not think is live.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1408305 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-11-12 14:37:12 +00:00
parent ea255484c4
commit 267df1a190
2 changed files with 4 additions and 1 deletions

View File

@ -181,6 +181,9 @@ Other Changes
* SOLR-3856: New tests for SqlEntityProcessor/CachedSqlEntityProcessor * SOLR-3856: New tests for SqlEntityProcessor/CachedSqlEntityProcessor
(James Dyer) (James Dyer)
* SOLR-4067: ZkStateReader#getLeaderProps should not return props for a leader
that it does not think is live. (Mark Miller)
================== 4.0.0 ================== ================== 4.0.0 ==================
Versions of Major Components Versions of Major Components

View File

@ -408,7 +408,7 @@ public class ZkStateReader {
while (System.currentTimeMillis() < timeoutAt) { while (System.currentTimeMillis() < timeoutAt) {
if (clusterState != null) { if (clusterState != null) {
final ZkNodeProps nodeProps = clusterState.getLeader(collection, shard); final ZkNodeProps nodeProps = clusterState.getLeader(collection, shard);
if (nodeProps != null) { if (nodeProps != null && getClusterState().liveNodesContain((String) nodeProps.get(ZkStateReader.NODE_NAME_PROP))) {
return nodeProps; return nodeProps;
} }
} }