Today submitting an unbatched `ClusterStateUpdateTask` to the `MasterService` is deprecated, and devs are encouraged to write their own batching executor instead. In principle this makes it possible to combine updates without incurring the costs of building a whole new `ClusterState` on each iteration, but in practice most implementations don't work at a lower level and just iteratively update a `ClusterState`. Moreover creating new `ClusterState` instances is nothing like as expensive as once it was.

We should accept this and provide some friendlier utilities for writing batched cluster state updates, ideally leaving the developer to express the desired per-task update as a `ClusterState -> ClusterState` operator.
server/src/main/java/org/elasticsearch/reservedstate/service/ReservedStateErrorTaskExecutor.java
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.ClusterStateTaskExecutor;
/**
 * Reserved cluster error state task executor
 * <p>
 * We use this task executor to record any errors while updating and reserving the cluster state
 */
record ReservedStateErrorTaskExecutor() implements ClusterStateTaskExecutor<ReservedStateErrorTask> {
    private static final Logger logger = LogManager.getLogger(ReservedStateErrorTaskExecutor.class);
    @Override
    public ClusterState execute(BatchExecutionContext<ReservedStateErrorTask> batchExecutionContext) {
        var updatedState = batchExecutionContext.initialState();
        for (final var taskContext : batchExecutionContext.taskContexts()) {
            final var task = taskContext.getTask();
            if (task.shouldUpdate(updatedState)) {
                try (var ignored = taskContext.captureResponseHeaders()) {
                    updatedState = task.execute(updatedState);
                }
            }
            
            taskContext.success(() -> task.listener().onResponse(ActionResponse.Empty.INSTANCE));
        }
        return updatedState;
    }
    @Override
    public void clusterStatePublished(ClusterState newClusterState) {
        logger.debug("Wrote new error state in reserved cluster state metadata");
    }
}