diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/jgroups/JgroupsDiscovery.java b/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/jgroups/JgroupsDiscovery.java index 6ddd1b3910b..051afacd3c2 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/jgroups/JgroupsDiscovery.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/jgroups/JgroupsDiscovery.java @@ -145,6 +145,7 @@ public class JgroupsDiscovery extends AbstractLifecycleComponent impl this.localNode = new Node(settings.get("name"), settings.getAsBoolean("node.data", true), channel.getAddress().toString(), transportService.boundAddress().publishAddress()); if (isMaster()) { + firstMaster = true; clusterService.submitStateUpdateTask("jgroups-disco-initialconnect(master)", new ProcessedClusterStateUpdateTask() { @Override public ClusterState execute(ClusterState currentState) { Nodes.Builder builder = new Nodes.Builder() @@ -159,7 +160,6 @@ public class JgroupsDiscovery extends AbstractLifecycleComponent impl sendInitialStateEventIfNeeded(); } }); - firstMaster = true; addressSet = true; } else { clusterService.submitStateUpdateTask("jgroups-disco-initialconnect", new ClusterStateUpdateTask() {