ZenDiscovery: #11960 failed to remove eager reroute from node join
It is removed now :) Closes #12019
This commit is contained in:
parent
9495816cb7
commit
d74eac94f2
|
@ -30,6 +30,7 @@ import org.elasticsearch.cluster.metadata.IndexMetaData;
|
|||
import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingNode;
|
||||
import org.elasticsearch.cluster.routing.RoutingService;
|
||||
import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
|
||||
import org.elasticsearch.cluster.service.InternalClusterService;
|
||||
|
@ -939,14 +940,15 @@ public class ZenDiscovery extends AbstractLifecycleComponent<Discovery> implemen
|
|||
}
|
||||
}
|
||||
|
||||
ClusterState.Builder stateBuilder = ClusterState.builder(currentState);
|
||||
|
||||
// we must return a new cluster state instance to force publishing. This is important
|
||||
// for the joining node to finalize it's join and set us as a master
|
||||
final ClusterState.Builder newState = ClusterState.builder(currentState);
|
||||
if (nodeAdded) {
|
||||
stateBuilder.nodes(nodesBuilder);
|
||||
newState.nodes(nodesBuilder);
|
||||
}
|
||||
currentState = stateBuilder.build();
|
||||
// eagerly run reroute to apply the node addition
|
||||
RoutingAllocation.Result result = routingService.getAllocationService().reroute(currentState);
|
||||
return ClusterState.builder(currentState).routingResult(result).build();
|
||||
|
||||
return newState.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue