Skip to content

Commit

Permalink
Added feature flag checks for the validations
Browse files Browse the repository at this point in the history
  • Loading branch information
vinaykpud committed Dec 31, 2024
1 parent b985309 commit ad07caf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,9 @@ public void validateIndexSettings(String indexName, final Settings settings, fin
throws IndexCreationException {
List<String> 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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ad07caf

Please sign in to comment.