private Result canSetStateMaintenanceTemporarily(StorageNodeInfo nodeInfo, ClusterState clusterState,
                                                     String newDescription) {
        var result = checkIfStateSetWithDifferentDescription(nodeInfo, newDescription);
        if (result.notAllowed())
            return result;

        if (isGroupedSetup()) {
            if (maxNumberOfGroupsAllowedToBeDown == -1) {
                result = checkIfAnotherNodeInAnotherGroupHasWantedState(nodeInfo);
                if (result.notAllowed())
                    return result;
                if (anotherNodeInGroupAlreadyAllowed(nodeInfo, newDescription))
                    return allow();
            } else {
                var optionalResult = checkIfOtherNodesHaveWantedState(nodeInfo, newDescription, clusterState);
                if (optionalResult.isPresent())
                    return optionalResult.get();
            }
        } else {
            result = otherNodeHasWantedState(nodeInfo);
            if (result.notAllowed())
                return result;
        }

        if (nodeIsDown(clusterState, nodeInfo)) {
            log.log(FINE, "node is DOWN, allow");
            return allow();
        }

        result = checkIfNodesAreUpOrRetired(clusterState);
        if (result.notAllowed()) {
            log.log(FINE, "nodesAreUpOrRetired: " + result);
            return result;
        }

        result = checkClusterStateAndRedundancy(nodeInfo.getNode(), clusterState.getVersion());
        if (result.notAllowed()) {
            log.log(FINE, "checkDistributors: "+ result);
            return result;
        }

        return allow();
    }
Checks if a node can be upgraded.

@author Haakon Dybdahl
clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeStateChangeChecker.java