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/test/java/org/elasticsearch/reservedstate/service/ReservedClusterStateServiceTests.java
@Override
                    public void onFailure(Exception e) {}
                }
            )
        );
        doReturn(state).when(task).execute(any());
        ClusterStateTaskExecutor.TaskContext<ReservedStateUpdateTask> taskContext = new ClusterStateTaskExecutor.TaskContext<>() {
            @Override
            public ReservedStateUpdateTask getTask() {
                return task;
            }
            @Override
            public void success(Runnable onPublicationSuccess) {
                onPublicationSuccess.run();
                successCalled.set(true);
            }
            @Override
            public void success(Consumer<ClusterState> publishedStateConsumer) {}
            @Override
            public void success(Runnable onPublicationSuccess, ClusterStateAckListener clusterStateAckListener) {}
            @Override
            public void success(Consumer<ClusterState> publishedStateConsumer, ClusterStateAckListener clusterStateAckListener) {}
            @Override
            public void onFailure(Exception failure) {}
            @Override
            public Releasable captureResponseHeaders() {
                return null;
            }
        };
        ClusterState newState = taskExecutor.execute(