From a536cb354880c92721a0d27625be61776368bb96 Mon Sep 17 00:00:00 2001 From: Shalin Shekhar Mangar Date: Fri, 18 Apr 2014 05:30:37 +0000 Subject: [PATCH] SOLR-5993: ZkController can warn about shard leader conflict even after the conflict is resolved git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1588415 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 3 +++ .../src/java/org/apache/solr/cloud/ZkController.java | 11 +++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 62db0ecf7ee..14627227523 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -108,6 +108,9 @@ Bug Fixes was an exception while trying to register as the leader. (Mark Miller, Alan Woodward) +* SOLR-5993: ZkController can warn about shard leader conflict even after the conflict + is resolved. (Gregory Chanan via shalin) + Other Changes --------------------- diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkController.java b/solr/core/src/java/org/apache/solr/cloud/ZkController.java index 8d9652d53d4..4755748efbc 100644 --- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java +++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java @@ -856,19 +856,18 @@ public final class ZkController { + cloudDesc.getShardId() + " our state says:" + clusterStateLeaderUrl + " but zookeeper says:" + leaderUrl); } - Thread.sleep(msInSec); tries++; - clusterStateLeaderUrl = zkStateReader.getLeaderUrl(collection, shardId, - timeoutms); - leaderUrl = getLeaderProps(collection, cloudDesc.getShardId(), timeoutms) - .getCoreUrl(); - if (tries % 30 == 0) { String warnMsg = String.format(Locale.ENGLISH, "Still seeing conflicting information about the leader " + "of shard %s for collection %s after %d seconds; our state says %s, but ZooKeeper says %s", cloudDesc.getShardId(), collection, tries, clusterStateLeaderUrl, leaderUrl); log.warn(warnMsg); } + Thread.sleep(msInSec); + clusterStateLeaderUrl = zkStateReader.getLeaderUrl(collection, shardId, + timeoutms); + leaderUrl = getLeaderProps(collection, cloudDesc.getShardId(), timeoutms) + .getCoreUrl(); } } catch (Exception e) {