SOLR-3511 make sure parent node exits before using the queue, check leader status before every update when in fallback mode

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1348760 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sami Siren 2012-06-11 09:22:03 +00:00
parent 3670f4b3c9
commit ad21fb3947
1 changed files with 2 additions and 1 deletions

View File

@ -80,7 +80,7 @@ public class Overseer {
CloudState cloudState = reader.getCloudState();
log.info("Replaying operations from work queue.");
while (head != null) {
while (head != null && amILeader()) {
final ZkNodeProps message = ZkNodeProps.load(head);
final String operation = message
.get(QUEUE_OPERATION);
@ -381,6 +381,7 @@ public class Overseer {
public Overseer(final ZkStateReader reader, final String id) throws KeeperException, InterruptedException {
log.info("Overseer (id=" + id + ") starting");
createOverseerNode(reader.getZkClient());
//launch cluster state updater thread
ThreadGroup tg = new ThreadGroup("Overseer state updater.");
Thread updaterThread = new Thread(tg, new CloudStateUpdater(reader, id));