private NodeCandidate unretireNodeInExpandedGroup(NodeCandidate candidate, int[] countInGroup) {
        if ( ! candidate.allocation().get().membership().retired()) return candidate;
        var currentGroup = candidate.allocation().get().membership().cluster().group();
        if (currentGroup.isEmpty()) return candidate;
        if (currentGroup.get().index() >= requested.groups()) return candidate;
        if (candidate.preferToRetire() || candidate.wantToRetire()) return candidate;
        if (requested.count().isPresent() && countInGroup[currentGroup.get().index()] >= requested.groupSize()) return candidate;
        candidate = unretire(candidate);
        if (candidate.allocation().get().membership().retired()) return candidate;
        countInGroup[currentGroup.get().index()]++;
        return candidate;
    }
Unretire nodes that are already in the correct group when the group is deficient.
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/GroupAssigner.java