diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateIndexService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateIndexService.java index 6812a53be64f7..ce8270c858525 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateIndexService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateIndexService.java @@ -1469,7 +1469,9 @@ public void validateIndexSettings(String indexName, final Settings settings, fin throws IndexCreationException { List validationErrors = getIndexSettingsValidationErrors(settings, forbidPrivateIndexSettings, indexName); validateIndexReplicationTypeSettings(settings, clusterService.getClusterSettings()).ifPresent(validationErrors::add); - validateAutoExpandReplicaConflictInRequest(settings).ifPresent(validationErrors::add); + if (FeatureFlags.isEnabled(FeatureFlags.READER_WRITER_SPLIT_EXPERIMENTAL_SETTING)) { + validateAutoExpandReplicaConflictInRequest(settings).ifPresent(validationErrors::add); + } validateErrors(indexName, validationErrors); } diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataUpdateSettingsService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataUpdateSettingsService.java index f2753c6d7994c..de099f0c8551f 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataUpdateSettingsService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataUpdateSettingsService.java @@ -231,10 +231,12 @@ public ClusterState execute(ClusterState currentState) { metadata.getSettings() ).ifPresent(validationErrors::add); - validateAutoExpandReplicaConflictInRequest(normalizedSettings).ifPresent(validationErrors::add); - validateAutoExpandReplicaConflictWithIndex(normalizedSettings, metadata.getSettings()).ifPresent( - validationErrors::add - ); + if (FeatureFlags.isEnabled(FeatureFlags.READER_WRITER_SPLIT_EXPERIMENTAL_SETTING)) { + validateAutoExpandReplicaConflictInRequest(normalizedSettings).ifPresent(validationErrors::add); + validateAutoExpandReplicaConflictWithIndex(normalizedSettings, metadata.getSettings()).ifPresent( + validationErrors::add + ); + } } if (validationErrors.size() > 0) {