Today the `ReservedClusterStateService` decides whether or not to submit an update-error task depending on the content of the last-applied state as exposed by `ClusterService#state()`. This may happen concurrently with another state being published, so does not give a fully consistent view of the latest state. Instead it should check the state within the cluster state task executor, triggering a no-op update as appropriate.
server/src/main/java/org/elasticsearch/reservedstate/service/ReservedClusterStateService.java
return;
        }
        
        
        
        
        executeNonStateTransformationSteps(trialRunResult.nonStateTransforms, new ActionListener<>() {
            @Override
            public void onResponse(Collection<NonStateTransformResult> nonStateTransformResults) {
                
                
                
                clusterService.submitStateUpdateTask(
                    "reserved cluster state [" + namespace + "]",
                    new ReservedStateUpdateTask(
                        namespace,
                        reservedStateChunk,
                        nonStateTransformResults,
                        handlers,
                        orderedHandlers,
                        (clusterState, errorState) -> saveErrorState(clusterState, errorState),
                        new ActionListener<>() {
                            @Override
                            public void onResponse(ActionResponse.Empty empty) {
                                logger.info("Successfully applied new reserved cluster state for namespace [{}]", namespace);
                                errorListener.accept(null);
                            }
                            @Override
                            public void onFailure(Exception e) {