do a reroute when a node becomes master

This commit is contained in:
kimchy 2010-07-23 20:55:26 +03:00
parent f6255f8ad9
commit 23ddf8bc53
1 changed files with 2 additions and 0 deletions

View File

@ -81,6 +81,8 @@ public class RoutingService extends AbstractLifecycleComponent<RoutingService> i
if (event.state().nodes().localNodeMaster()) {
// we are master, schedule the routing table updater
if (scheduledRoutingTableFuture == null) {
// a new master (us), make sure we reroute shards
routingTableDirty = true;
scheduledRoutingTableFuture = threadPool.scheduleWithFixedDelay(new RoutingTableUpdater(), schedule);
}
if (event.nodesRemoved() || event.routingTableChanged()) {