mirror of https://github.com/apache/lucene.git
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:
parent
88ce4ab029
commit
ffd693605a
|
@ -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
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue