You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2012/12/30 06:54:59 UTC
svn commit: r1426892 - in /lucene/dev/trunk/solr: CHANGES.txt
core/src/java/org/apache/solr/cloud/ZkController.java
Author: markrmiller
Date: Sun Dec 30 05:54:59 2012
New Revision: 1426892
URL: http://svn.apache.org/viewvc?rev=1426892&view=rev
Log:
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.
Modified:
lucene/dev/trunk/solr/CHANGES.txt
lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkController.java
Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1426892&r1=1426891&r2=1426892&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Sun Dec 30 05:54:59 2012
@@ -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
----------------------
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkController.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkController.java?rev=1426892&r1=1426891&r2=1426892&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkController.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkController.java Sun Dec 30 05:54:59 2012
@@ -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) {