You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by an...@apache.org on 2015/06/14 21:16:12 UTC
svn commit: r1685446 -
/lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java
Author: andyetitmoves
Date: Sun Jun 14 19:16:11 2015
New Revision: 1685446
URL: http://svn.apache.org/r1685446
Log:
Tweak leadership election trace to aid debugging
Modified:
lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java?rev=1685446&r1=1685445&r2=1685446&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java Sun Jun 14 19:16:11 2015
@@ -181,6 +181,7 @@ public class LeaderElector {
String watchedNode = holdElectionPath + "/" + seqs.get(toWatch);
zkClient.getData(watchedNode, watcher = new ElectionWatcher(context.leaderSeqPath , watchedNode,seq, context) , null, true);
+ log.info("Watching path {} to know if I could be the leader", watchedNode);
} catch (KeeperException.SessionExpiredException e) {
throw e;
} catch (KeeperException e) {
@@ -278,7 +279,7 @@ public class LeaderElector {
while (cont) {
try {
if(joinAtHead){
- log.info("node {} Trying to join election at the head ", id);
+ log.info("Node {} trying to join election at the head", id);
List<String> nodes = OverseerCollectionProcessor.getSortedElectionNodes(zkClient, shardsElectZkPath);
if(nodes.size() <2){
leaderSeqPath = zkClient.create(shardsElectZkPath + "/" + id + "-n_", null,
@@ -293,14 +294,13 @@ public class LeaderElector {
}
leaderSeqPath = shardsElectZkPath + "/" + id + "-n_"+ m.group(1);
zkClient.create(leaderSeqPath, null, CreateMode.EPHEMERAL, false);
- log.info("Joined at the head {}", leaderSeqPath );
-
}
} else {
leaderSeqPath = zkClient.create(shardsElectZkPath + "/" + id + "-n_", null,
CreateMode.EPHEMERAL_SEQUENTIAL, false);
}
+ log.info("Joined leadership election with path: {}", leaderSeqPath);
context.leaderSeqPath = leaderSeqPath;
cont = false;
} catch (ConnectionLossException e) {