Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow removing index.number_of_replicas setting (#56656)
Today a user can create an index without setting the index.number_of_replicas setting even though the index metadata requires that the setting has a value. We do this when creating an index by explicitly settings index.number_of_replicas to a default value if one is not provided. However, if a user updates the number of replicas, and then let wants to return to the default value, they are naturally inclined to try setting this setting to null, as the agreed upon way to return a setting to its default. Since the index metadata requires that this setting has a non-null value, we blow up when a user attempts to make this change. This is because we are not taking the same action when updating a setting on an index that we take when create an index. Namely, we are not explicitly setting index.number_of_replicas if the request does not carry a value for this setting. This would happen when nulling the setting, which we want to support. This commit addresses this by setting index.number_of_replicas to the default if the value for this setting is null when updating the settings for an index.
- Loading branch information