SOLR-4244: When coming back from session expiration we should not wait for the leader to see us in the down state if we are the node that must become the leader.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1426892 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-12-30 05:54:59 +00:00
parent 88ce4ab029
commit ffd693605a
2 changed files with 31 additions and 0 deletions

View File

@ -408,6 +408,11 @@ Bug Fixes
* SOLR-4175:SearchComponent chain can't contain two components of the
same class and use debugQuery. (Tomás Fernández Löbbe via ehatcher)
* SOLR-4244: When coming back from session expiration we should not wait for
the leader to see us in the down state if we are the node that must become
the leader. (Mark Miller)
Other Changes
----------------------

View File

@ -274,6 +274,32 @@ public final class ZkController {
continue;
}
}
// if it looks like we are going to be the leader, we don't
// want to wait for the following stuff
CloudDescriptor cloudDesc = descriptor.getCloudDescriptor();
String collection = cloudDesc.getCollectionName();
String slice = cloudDesc.getShardId();
try {
int children = zkStateReader
.getZkClient()
.getChildren(
ZkStateReader.COLLECTIONS_ZKNODE + "/" + collection
+ "/leader_elect/" + slice + "/election", null, true).size();
if (children == 0) {
return;
}
} catch (NoNodeException e) {
return;
} catch (InterruptedException e2) {
Thread.currentThread().interrupt();
} catch (KeeperException e) {
log.warn("", e);
Thread.currentThread().interrupt();
}
try {
waitForLeaderToSeeDownState(descriptor, coreZkNodeName);
} catch (Exception e) {