-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Description
Elasticsearch Version
8.x and main
Installed Plugins
No response
Java Version
bundled
OS Version
darwin
Problem Description
clusterSettings.initializeAndWatch can miss settings updates if called after the cluster state is applied.
This is due to initializeAndWatch reading the initial value from settings and ignoring lastSettingsApplied
elasticsearch/server/src/main/java/org/elasticsearch/common/settings/AbstractScopedSettings.java
Line 436 in 2f0010c
| consumer.accept(setting.get(settings)); |
Steps to Reproduce
Declare a dynamic setting
Call
clusterSettings.initializeAndWatch(DYNAMIC_SETTING, value -> this.dynamicSettingValue= value); when creating an index for example (or when creating the indices service) but only on a certain type of node, say data_warm
Start a master,data_hot,data_content node (not the data_warm one)
Change the value for the dynamic setting via the cluster settings API to a value different than the default
Start the data_warm node and notice that the initial value where you called initializeAndWatch is continuing to be the default
Logs (if relevant)
No response