River: Failure to reallocate river to another node on rivers node failure, closes #850.

This commit is contained in:
kimchy 2011-04-12 21:52:02 +03:00
parent e8503c1455
commit e9bc7f7d95
1 changed files with 5 additions and 0 deletions

View File

@ -123,10 +123,15 @@ public class RiversRouter extends AbstractLifecycleComponent<RiversRouter> imple
}
}
// now, remove routings that were deleted
// also, apply nodes that were removed and rivers were running on
for (RiverRouting routing : currentState.routing()) {
if (!indexMetaData.mappings().containsKey(routing.riverName().name())) {
routingBuilder.remove(routing);
dirty = true;
} else if (routing.node() != null && !event.state().nodes().nodeExists(routing.node().id())) {
routingBuilder.remove(routing);
routingBuilder.put(new RiverRouting(routing.riverName(), null));
dirty = true;
}
}