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
if (isNewError(existingMetadata, reservedStateVersion.version())) {
                                    logger.debug("Failed to apply reserved cluster state", e);
                                    errorListener.accept(e);
                                } else {
                                    errorListener.accept(null);
                                }
                            }
                        }
                    ),
                    ClusterStateTaskConfig.build(Priority.URGENT),
                    updateStateTaskExecutor
                );
            }
            @Override
            public void onFailure(Exception e) {
                
                errorListener.accept(checkAndReportError(namespace, List.of(e.getMessage()), state, reservedStateVersion));
            }
        });
    }
    
    Exception checkAndReportError(
        String namespace,
        List<String> errors,
        ClusterState currentState,
        ReservedStateVersion reservedStateVersion
    ) {
        
        if (errors.isEmpty() == false) {
            logger.debug("Error processing state change request for [{}] with the following errors [{}]", namespace, errors);