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/health/metadata/HealthMetadataService.java
readyToPublish = false;
            }
        }
    }
    private void updateOnSettingsUpdated(String setting, String value) {
        
        if (isMaster && enabled) {
            ClusterState clusterState = clusterService.state();
            if (clusterState.nodesIfRecovered().getMinNodeVersion().onOrAfter(Version.V_8_5_0)) {
                var task = new UpdateHealthMetadata(setting, value);
                var config = ClusterStateTaskConfig.build(Priority.NORMAL);
                clusterService.submitStateUpdateTask("health-metadata-update", task, config, executor);
            }
        }
    }
    private void resetHealthMetadata(String source) {
        var task = new InsertHealthMetadata(settings);
        var config = ClusterStateTaskConfig.build(Priority.NORMAL);
        clusterService.submitStateUpdateTask(source, task, config, executor);
    }
    public static List<NamedWriteableRegistry.Entry> getNamedWriteables() {
        return List.of(
            new NamedWriteableRegistry.Entry(ClusterState.Custom.class, HealthMetadata.TYPE, HealthMetadata::new),
            new NamedWriteableRegistry.Entry(NamedDiff.class, HealthMetadata.TYPE, HealthMetadata::readDiffFrom)
        );
    }
    /**
     * A base class for health metadata cluster state update tasks.
     */
    abstract static class UpsertHealthMetadataTask implements ClusterStateTaskListener {