Discovery: node join requests should be handled at lower priority than master election

When a node is elected as master or receives a join request, we submit a cluster state update task. We should give the node join update task a lower priority than the elect as master to increase the chance it will not be rejected. During master election there is a big chance that these will happen concurrently.

This commit lowers the priority of node joins from IMMEDIATE to URGENT

Closes #7733
This commit is contained in:
Boaz Leskes 2014-09-15 21:35:30 +02:00
parent ec28d7c465
commit 12cbb3223a
1 changed files with 1 additions and 1 deletions

View File

@ -853,7 +853,7 @@ public class ZenDiscovery extends AbstractLifecycleComponent<Discovery> implemen
// node calling the join request
membership.sendValidateJoinRequestBlocking(node, joinTimeout);
processJoinRequests.add(new Tuple<>(node, callback));
clusterService.submitStateUpdateTask("zen-disco-receive(join from node[" + node + "])", Priority.IMMEDIATE, new ProcessedClusterStateUpdateTask() {
clusterService.submitStateUpdateTask("zen-disco-receive(join from node[" + node + "])", Priority.URGENT, new ProcessedClusterStateUpdateTask() {
private final List<Tuple<DiscoveryNode, MembershipAction.JoinCallback>> drainedTasks = new ArrayList<>();