Don't reuse indexes of inactive nodes
@@ -104,7 +104,7 @@ class Preparer {
*/
private int findHighestIndex(ApplicationId application, ClusterSpec cluster) {
int highestIndex = -1;
- for (Node node : nodeRepository.getNodes(application, Node.State.active, Node.State.failed)) {
+ for (Node node : nodeRepository.getNodes(application, Node.State.active, Node.State.inactive, Node.State.failed)) {
ClusterSpec nodeCluster = node.allocation().get().membership().cluster();
if ( ! nodeCluster.id().equals(cluster.id())) continue;
if ( ! nodeCluster.type().equals(cluster.type())) continue;
