-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Make stack.templates.enabled a dynamic setting #63764
Make stack.templates.enabled a dynamic setting #63764
Conversation
This change allows the setting for disabling the automatically installed stack templates (the `logs-*-*`, `metrics-*-*`, and `synthetics-*-*` templates) to be changed dynamically. As a byproduct, it also moves thes `IndexTemplateRegistry` to use an `initialize()` method so that constructors are not tempted to use a `this` reference in the constructor (see elastic#37861 for more information about why to avoid that). Resolves elastic#62835
Pinging @elastic/es-core-features (:Core/Features/Features) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for working on this Lee
x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycle.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycle.java
Outdated
Show resolved
Hide resolved
this.stackTemplateEnabled = true; | ||
} else { | ||
logger.info( | ||
"stack composable templates [{}] and component templates [{}] will not be installed or reinstalled", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a bit confusing as to why this happened. Should we also mention that the setting was updated and as a result, the templates will not be installed/reinstalled anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the settings infrastructure already logs a message to that effect, so this looks like:
[2020-10-16T09:16:27,285][INFO ][o.e.c.s.ClusterSettings ] [runTask-0] updating [stack.templates.enabled] from [true] to [false]
[2020-10-16T09:16:27,286][INFO ][o.e.x.s.StackTemplateRegistry] [runTask-0] stack composable templates [logs,metrics,synthetics] and component templates [logs-mappings,logs-settings,metrics-mappings,metrics-settings,synthetics-mappings,synthetics-settings] will not be installed or reinstalled
That's why I left out any mention that the setting was updated (it happens regardless)
* Make stack.templates.enabled a dynamic setting This change allows the setting for disabling the automatically installed stack templates (the `logs-*-*`, `metrics-*-*`, and `synthetics-*-*` templates) to be changed dynamically. As a byproduct, it also moves thes `IndexTemplateRegistry` to use an `initialize()` method so that constructors are not tempted to use a `this` reference in the constructor (see elastic#37861 for more information about why to avoid that). Resolves elastic#62835
* Make stack.templates.enabled a dynamic setting This change allows the setting for disabling the automatically installed stack templates (the `logs-*-*`, `metrics-*-*`, and `synthetics-*-*` templates) to be changed dynamically. As a byproduct, it also moves thes `IndexTemplateRegistry` to use an `initialize()` method so that constructors are not tempted to use a `this` reference in the constructor (see #37861 for more information about why to avoid that). Resolves #62835
This change allows the setting for disabling the automatically installed stack templates (the
logs-*-*
,metrics-*-*
, andsynthetics-*-*
templates) to be changed dynamically.As a byproduct, it also moves thes
IndexTemplateRegistry
to use aninitialize()
method so thatconstructors are not tempted to use a
this
reference in the constructor (see #37861 and #38560for more information about why we want to avoid that).
Resolves #62835