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/cluster/metadata/MetadataIndexTemplateService.java
final Set<String> newlyUnreferenced = findUnreferencedDataStreams.apply(updatedMetadata);
        
        
        if (newlyUnreferenced.size() > currentlyUnreferenced.size()) {
            throw new IllegalArgumentException(
                "composable template ["
                    + templateName
                    + "] with index patterns "
                    + newTemplate.indexPatterns()
                    + ", priority ["
                    + newTemplate.priority()
                    + "] "
                    + (newTemplate.getDataStreamTemplate() == null ? "and no data stream configuration " : "")
                    + "would cause data streams "
                    + newlyUnreferenced
                    + " to no longer match a data stream template"
            );
        }
    }
    
    private static void validateTsdbDataStreamsReferringTsdbTemplate(
        ClusterState state,
        String templateName,
        ComposableIndexTemplate newTemplate
    ) {
        Metadata currentMetadata = state.getMetadata();
        Metadata updatedMetadata = null;
        Set<String> dataStreamsWithNonTsdbTemplate = null;
        for (var dataStream : state.metadata().dataStreams().values()) {