River: Failure to reallocate river to another node on rivers node failure, closes #850.
This commit is contained in:
parent
e8503c1455
commit
e9bc7f7d95
|
@ -123,10 +123,15 @@ public class RiversRouter extends AbstractLifecycleComponent<RiversRouter> imple
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// now, remove routings that were deleted
|
// now, remove routings that were deleted
|
||||||
|
// also, apply nodes that were removed and rivers were running on
|
||||||
for (RiverRouting routing : currentState.routing()) {
|
for (RiverRouting routing : currentState.routing()) {
|
||||||
if (!indexMetaData.mappings().containsKey(routing.riverName().name())) {
|
if (!indexMetaData.mappings().containsKey(routing.riverName().name())) {
|
||||||
routingBuilder.remove(routing);
|
routingBuilder.remove(routing);
|
||||||
dirty = true;
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue