private boolean isReplacement(NodeList nodesInCluster, Optional<ClusterSpec.Group> group) {
        NodeList nodesInGroup = group.map(ClusterSpec.Group::index)
                                     .map(nodesInCluster::group)
                                     .orElse(nodesInCluster);
        int failedNodesInGroup = nodesInGroup.failing().size() + nodesInGroup.state(Node.State.failed).size();
        if (failedNodesInGroup == 0) return false;
        return ! requested.fulfilledBy(nodesInGroup.size() - failedNodesInGroup);
    }
Returns whether we are allocating to replace a failed node
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodePrioritizer.java