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/ReservedStateUpdateTask.java
String namespace,
        ReservedStateChunk stateChunk,
        Collection<NonStateTransformResult> nonStateTransformResults,
        Map<String, ReservedClusterStateHandler<?>> handlers,
        Collection<String> orderedHandlers,
        BiConsumer<ClusterState, ErrorState> errorReporter,
        ActionListener<ActionResponse.Empty> listener
    ) {
        this.namespace = namespace;
        this.stateChunk = stateChunk;
        this.nonStateTransformResults = nonStateTransformResults;
        this.handlers = handlers;
        this.orderedHandlers = orderedHandlers;
        this.errorReporter = errorReporter;
        this.listener = listener;
    }
    @Override
    public void onFailure(Exception e) {
        listener.onFailure(e);
    }
    ActionListener<ActionResponse.Empty> listener() {
        return listener;
    }
    protected ClusterState execute(final ClusterState currentState) {
        ReservedStateMetadata existingMetadata = currentState.metadata().reservedStateMetadata().get(namespace);
        Map<String, Object> reservedState = stateChunk.state();
        ReservedStateVersion reservedStateVersion = stateChunk.metadata();
        if (checkMetadataVersion(namespace, existingMetadata, reservedStateVersion) == false) {
            return currentState;
        }