Skip to content

GET index/_settings?include_defaults returns the wrong default value for settings with default values dependent on other settings #47890

Closed
@gwbrown

Description

@gwbrown

The Get Index Settings API returns the wrong default for index.soft_deletes.enabled in the 7.x series.

This is because the default is computed based on the version the index was created in:

public static final Setting<Boolean> INDEX_SOFT_DELETES_SETTING = Setting.boolSetting("index.soft_deletes.enabled",
settings -> Boolean.toString(IndexMetaData.SETTING_INDEX_VERSION_CREATED.get(settings).onOrAfter(Version.V_7_0_0)),
Property.IndexScope, Property.Final);

But the version is not included in the Settings object passed to the default calculation function when called by the Get Index Settings API with the include_defaults flag. It looks like the Settings object passed to calculate the defaults in this circumstance is always empty, so any setting whose defaults depend on another setting is likely to be wrong as well.


Update:

This definitely impacts other settings, as can be seen in #51194 where an incorrect default value of index.merge.scheduler.max_merge_count is returned from GET index/settings?include_defaults because its default value depends on the value of index.merge.scheduler.max_thread_count.

Metadata

Metadata

Assignees

Labels

:Core/Infra/SettingsSettings infrastructure and APIs>bugTeam:Core/InfraMeta label for core/infra teamneeds:triageRequires assignment of a team area label

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions