update firstMaster before submitting state update

This commit is contained in:
kimchy 2010-04-03 02:25:22 +03:00
parent 65acc0cfa9
commit a5a4b35e39
1 changed files with 1 additions and 1 deletions

View File

@ -145,6 +145,7 @@ public class JgroupsDiscovery extends AbstractLifecycleComponent<Discovery> impl
this.localNode = new Node(settings.get("name"), settings.getAsBoolean("node.data", true), channel.getAddress().toString(), transportService.boundAddress().publishAddress()); this.localNode = new Node(settings.get("name"), settings.getAsBoolean("node.data", true), channel.getAddress().toString(), transportService.boundAddress().publishAddress());
if (isMaster()) { if (isMaster()) {
firstMaster = true;
clusterService.submitStateUpdateTask("jgroups-disco-initialconnect(master)", new ProcessedClusterStateUpdateTask() { clusterService.submitStateUpdateTask("jgroups-disco-initialconnect(master)", new ProcessedClusterStateUpdateTask() {
@Override public ClusterState execute(ClusterState currentState) { @Override public ClusterState execute(ClusterState currentState) {
Nodes.Builder builder = new Nodes.Builder() Nodes.Builder builder = new Nodes.Builder()
@ -159,7 +160,6 @@ public class JgroupsDiscovery extends AbstractLifecycleComponent<Discovery> impl
sendInitialStateEventIfNeeded(); sendInitialStateEventIfNeeded();
} }
}); });
firstMaster = true;
addressSet = true; addressSet = true;
} else { } else {
clusterService.submitStateUpdateTask("jgroups-disco-initialconnect", new ClusterStateUpdateTask() { clusterService.submitStateUpdateTask("jgroups-disco-initialconnect", new ClusterStateUpdateTask() {