From 267df1a190afa2f1bc086730b7f7ed0da6fdf308 Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Mon, 12 Nov 2012 14:37:12 +0000 Subject: [PATCH] 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 --- solr/CHANGES.txt | 3 +++ .../src/java/org/apache/solr/common/cloud/ZkStateReader.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 7598ccf3e35..15a8b8b3646 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -181,6 +181,9 @@ Other Changes * SOLR-3856: New tests for SqlEntityProcessor/CachedSqlEntityProcessor (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 ================== Versions of Major Components diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java index e79893876b3..02c8b4f325c 100644 --- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java +++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java @@ -408,7 +408,7 @@ public class ZkStateReader { while (System.currentTimeMillis() < timeoutAt) { if (clusterState != null) { final ZkNodeProps nodeProps = clusterState.getLeader(collection, shard); - if (nodeProps != null) { + if (nodeProps != null && getClusterState().liveNodesContain((String) nodeProps.get(ZkStateReader.NODE_NAME_PROP))) { return nodeProps; } }