Skip to content

Commit

Permalink
Revert "[Discovery] immediately start Master|Node fault detection pin…
Browse files Browse the repository at this point in the history
…ging"

In #6706 we change the master validation to start pining immediately after a new master as ellected or a node joined. The idea is to have a quicker response to failures. This does however create a problem if the new master has yet fully processed it's ellection and responds to the ping with a NoLongerMasterException. This causes the source node to remove the current master and ellect another, only to find out it's not a master either and so forth. We are moving this change to the feature/improve_zen branch, where the improvements we made will cause the situation to be handled properly.

This reverts commit ae16956.
  • Loading branch information
bleskes committed Jul 8, 2014
1 parent 5306f29 commit 20cd74d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Expand Up @@ -153,9 +153,8 @@ private void innerStart(final DiscoveryNode masterNode) {
masterPinger.stop();
}
this.masterPinger = new MasterPinger();

// we use schedule with a 0 time value to run the pinger on the pool as it will run on later
threadPool.schedule(TimeValue.timeValueMillis(0), ThreadPool.Names.SAME, masterPinger);
// start the ping process
threadPool.schedule(pingInterval, ThreadPool.Names.SAME, masterPinger);
}

public void stop(String reason) {
Expand Down Expand Up @@ -199,8 +198,7 @@ private void handleTransportDisconnect(DiscoveryNode node) {
masterPinger.stop();
}
this.masterPinger = new MasterPinger();
// we use schedule with a 0 time value to run the pinger on the pool as it will run on later
threadPool.schedule(TimeValue.timeValueMillis(0), ThreadPool.Names.SAME, masterPinger);
threadPool.schedule(pingInterval, ThreadPool.Names.SAME, masterPinger);
} catch (Exception e) {
logger.trace("[master] [{}] transport disconnected (with verified connect)", masterNode);
notifyMasterFailure(masterNode, "transport disconnected (with verified connect)");
Expand Down
Expand Up @@ -119,8 +119,7 @@ public void updateNodes(DiscoveryNodes nodes) {
}
if (!nodesFD.containsKey(newNode)) {
nodesFD.put(newNode, new NodeFD());
// we use schedule with a 0 time value to run the pinger on the pool as it will run on later
threadPool.schedule(TimeValue.timeValueMillis(0), ThreadPool.Names.SAME, new SendPingRequest(newNode));
threadPool.schedule(pingInterval, ThreadPool.Names.SAME, new SendPingRequest(newNode));
}
}
for (DiscoveryNode removedNode : delta.removedNodes()) {
Expand Down Expand Up @@ -166,8 +165,7 @@ private void handleTransportDisconnect(DiscoveryNode node) {
try {
transportService.connectToNode(node);
nodesFD.put(node, new NodeFD());
// we use schedule with a 0 time value to run the pinger on the pool as it will run on later
threadPool.schedule(TimeValue.timeValueMillis(0), ThreadPool.Names.SAME, new SendPingRequest(node));
threadPool.schedule(pingInterval, ThreadPool.Names.SAME, new SendPingRequest(node));
} catch (Exception e) {
logger.trace("[node ] [{}] transport disconnected (with verified connect)", node);
notifyNodeFailure(node, "transport disconnected (with verified connect)");
Expand Down

0 comments on commit 20cd74d

Please sign in to comment.