-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Make xpack.ilm.enabled setting a no-op #55592
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 xpack.ilm.enabled setting a no-op #55592
Conversation
|
Pinging @elastic/es-core-infra (:Core/Infra/Plugins) |
|
@elasticmachine test this please |
|
@elasticmachine please run elasticsearch-ci/2 |
1 similar comment
|
@elasticmachine please run elasticsearch-ci/2 |
|
I think I ought to add a new Watcher-specific setting that replaces how the old
|
...ugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SnapshotLifecycleInitialisationTests.java
Outdated
Show resolved
Hide resolved
| templatesToUse = Arrays.asList( | ||
| ANOMALY_DETECTION_RESULTS_TEMPLATE, | ||
| ilmEnabled ? ANOMALY_DETECTION_STATE_TEMPLATE : ANOMALY_DETECTION_STATE_TEMPLATE_NO_ILM, | ||
| ANOMALY_DETECTION_STATE_TEMPLATE, |
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.
Can we remove ANOMALY_DETECTION_STATE_TEMPLATE_NO_ILM and STATS_TEMPLATE_NO_ILM now?
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 will reach out to someone from ML to see if this change is OK, but I would guess that we will be able to remove those templates.
- get feedback from someone on ML for removing
NO_ILMtemplates
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.
@dimitris-athanasiou and @przemekwitek have confirmed that these templates can be removed.
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.
(Przemek from ML team): I think it is ok to remove the non-ILM versions.
Once only ILM versions exist, it would be good to inline the variables into the .json files but if you don't feel like doing it, I can do it as a followup PR.
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.
@przemekwitek Do you mean like this?
private static IndexTemplateConfig stateTemplate() {
Map<String, String> variables = new HashMap<>();
variables.put(VERSION_ID_PATTERN, String.valueOf(Version.CURRENT.id));
variables.put("xpack.ml.index.lifecycle.name", ML_SIZE_BASED_ILM_POLICY_NAME);
variables.put("xpack.ml.index.rollover_alias.name", AnomalyDetectorsIndex.jobStateIndexWriteAlias());
return new IndexTemplateConfig(AnomalyDetectorsIndexFields.STATE_INDEX_PREFIX,
ANOMALY_DETECTION_PATH + "state_index_template.json",
Version.CURRENT.id, VERSION_PATTERN,
variables);
}
…with this in the template json file?
"settings" : {
"index" : {
"auto_expand_replicas" : "0-1",
"hidden": true
},
"index.lifecycle.name": "${xpack.ml.index.lifecycle.name}",
"index.lifecycle.rollover_alias": "${xpack.ml.index.rollover_alias.name}"
},
Or should the actual values be inlined as well?
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.
Any of these 2 solutions work for me.
It's most important for me to get rid of syntax tokens (like comma ",") which were just a hack to allow enabled/disabled duality.
The first one is more flexible so my preference goes there.
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've pushed a commit with the first, more flexible strategy. Thanks for the feedback!
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.
Could you make the variable name the same for both templates?
I.e. xpack.ml.index.lifecycle.name and xpack.ml.index.lifecycle.rollover_alias for both state and stats templates?
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.
Good catch. This is done.
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.
Thank you!
przemekwitek
left a comment
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
| templatesToUse = Arrays.asList( | ||
| ANOMALY_DETECTION_RESULTS_TEMPLATE, | ||
| ilmEnabled ? ANOMALY_DETECTION_STATE_TEMPLATE : ANOMALY_DETECTION_STATE_TEMPLATE_NO_ILM, | ||
| ANOMALY_DETECTION_STATE_TEMPLATE, |
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.
Thank you!
|
@elasticmachine please run elasticsearch-ci/bwc |
rjernst
left a comment
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.
Thanks for adding the fallback to the old setting, so that users do not suddenly break if they were using curator externally for watcher management. LGTM.
|
Rats. Github lost the commit message I wrote and used the generated commit summary message instead. Here's what I wanted to use: |
* Make xpack.ilm.enabled setting a no-op * Add watcher setting to not use ILM * Update documentation for no-op setting * Remove NO_ILM ml index templates * Remove unneeded setting from test setup * Inline variable definitions for ML templates * Use identical parameter names in templates * New ILM/watcher setting falls back to old setting * Add fallback unit test for watcher/ilm setting
* Make xpack.ilm.enabled setting a no-op * Add watcher setting to not use ILM * Update documentation for no-op setting * Remove NO_ILM ml index templates * Remove unneeded setting from test setup * Inline variable definitions for ML templates * Use identical parameter names in templates * New ILM/watcher setting falls back to old setting * Add fallback unit test for watcher/ilm setting
In #55592 and #55416, we deprecated the settings for enabling and disabling basic license features and turned those settings into no-ops. Since doing so, we've had feedback that this change may not give users enough time to cleanly switch from non-ILM index management tools to ILM. If two index managers operate simultaneously, results could be strange and difficult to reconstruct. We don't know of any cases where SLM will cause a problem, but we are restoring that setting as well, to be on the safe side. This PR is not a strict commit reversion. First, we are keeping the new xpack.watcher.use_ilm_index_management setting, introduced when xpack.ilm.enabled was made a no-op, so that users can begin migrating to using it. Second, the SLM setting was modified in the same commit as a group of other settings, so I have taken just the changes relating to SLM.
In elastic#55592 and elastic#55416, we deprecated the settings for enabling and disabling basic license features and turned those settings into no-ops. Since doing so, we've had feedback that this change may not give users enough time to cleanly switch from non-ILM index management tools to ILM. If two index managers operate simultaneously, results could be strange and difficult to reconstruct. We don't know of any cases where SLM will cause a problem, but we are restoring that setting as well, to be on the safe side. This PR is not a strict commit reversion. First, we are keeping the new xpack.watcher.use_ilm_index_management setting, introduced when xpack.ilm.enabled was made a no-op, so that users can begin migrating to using it. Second, the SLM setting was modified in the same commit as a group of other settings, so I have taken just the changes relating to SLM.
In #54816, we deprecated a group of toggle settings for basic license level features. In #55416 (in review), we are turning most of those settings into no-ops, i.e., having them in your settings file won't throw an error, but they won't do anything at all. I left monitoring and ILM for separate PRs because turning them into no-ops affects logic in other modules.
This PR turns
xpack.ilm.enabledinto a no-op. It removes logic and tests in xpack core, ML, and Watcher. The latter two modules in particular had to switch behavior based on the enablement or disablement of ILM, which is the kind of thing we're trying to eliminate with this effort; ILM should be a basic "building block" for higher level modules.Meta issue: #54745