-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
index.number_of_replicas cannot be reset to a default value #56501
Comments
Pinging @elastic/es-core-infra (:Core/Infra/Settings) |
Pinging @elastic/es-docs (>docs) |
@Ingramz thanks for raising this, I'm not sure its a bug or the intended behaviour that should be documented better. Labeling accordingly so the team can weigh in. |
This is a bug, I opened #56656. |
Pinging @elastic/es-core-features (:Core/Features/Indices APIs) |
I'm relabeling this since this isn't a general problem with the settings infrastructure, but a case for this specific API (the update index settings API). |
The Setting class provides the ability to define a setting, a default value, along with validation logic. However, there are still many uses of thhe old getAsXXX methods on Settings. This commit converts one of those cases, reading the index number_of_replicas setting, so that the default is not defined in multiple places. relates elastic#56656 relates elastic#56501
Elasticsearch version (
bin/elasticsearch --version
): 7.6.2Plugins installed: []
JVM version (
java -version
): BundledOS version (
uname -a
if on a Unix-like system): AnyDescription of the problem including expected versus actual behavior:
Per documentation, one should be able to reset an index setting to its default value by using
null
as value. This seems to work for a setting such asrefresh_interval
, but not fornumber_of_replicas
, resulting in following response:It is uncertain whether there are more settings that exhibit this behavior.
Steps to reproduce:
Create Index:
PUT /twitter
Check defaults (see that
number_of_replicas
is 1):GET /twitter
Set
number_of_replicas
temporarily to 0:Verify that
number_of_replicas
is 0:GET /twitter
Try to reset the value per documentation:
Provide logs (if relevant): N/A
The text was updated successfully, but these errors were encountered: