Skip to content

Settings initializeAndWatch can miss settings changes #133701

@andreidan

Description

@andreidan

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions