Improve ILM policy and alias setup log output#24480
Merged
urso merged 10 commits intoelastic:masterfrom Mar 26, 2021
Merged
Conversation
Contributor
|
Pinging @elastic/agent (Team:Agent) |
urso
commented
Mar 10, 2021
Author
There was a problem hiding this comment.
The test was wrong. When overwrite is enabled we ignore checkExists and always attempt to create the resource. The mock as configured checks that: HasPolicy will not be called, ILMPolicy will be created and indicates success.
added 2 commits
March 10, 2021 20:07
The idxmgmt has not all 'information' to properly log the outcome of the policy and status setup. The PR moves the reporting to the ILM package directly, and 'unifies' the logic of EnsurePolicy and EnsureAlias.
a89a5bb to
3f61d76
Compare
Contributor
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
added 2 commits
March 10, 2021 20:14
kvch
reviewed
Mar 22, 2021
kvch
approved these changes
Mar 25, 2021
urso
pushed a commit
to urso/beats
that referenced
this pull request
Mar 26, 2021
(cherry picked from commit 4edc6dc)
3 tasks
urso
pushed a commit
that referenced
this pull request
Mar 29, 2021
axw
added a commit
to axw/apm-server
that referenced
this pull request
Apr 13, 2021
axw
added a commit
to elastic/apm-server
that referenced
this pull request
Apr 13, 2021
* Update to elastic/beats@abd6a93bf275 * idxmgmt: update test due to libbeat change See elastic/beats#24480
axw
added a commit
to axw/apm-server
that referenced
this pull request
Apr 13, 2021
axw
added a commit
to elastic/apm-server
that referenced
this pull request
Apr 13, 2021
* Update to elastic/beats@205e3dd3eef2 * idxmgmt: update test due to libbeat change See elastic/beats#24480 * Update to elastic/beats@18f4e405ad11
bmorelli25
pushed a commit
to bmorelli25/observability-docs
that referenced
this pull request
Dec 18, 2023
* Update to elastic/beats@abd6a93bf275 * idxmgmt: update test due to libbeat change See elastic/beats#24480
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The idxmgmt has not all 'information' to properly log the outcome of the
policy and status setup. The PR moves the reporting to the ILM package
directly, and 'unifies' the logic of EnsurePolicy and EnsureAlias.
Why is it important?
The change fixes the status reporting for the ILM and index alias setup, that is written to the logs.
With the fix one can tell if some resources have been installed, or not, depending on the actual settings in the configuration file. Before it was potentially reported that a policy/alias has been created, although the creation of the resources was disabled.
The change also updates EnsurePolicy/EnsureAlias to follow a similar pattern, which makes it a little easier to follow the code. We now allow EnsureAlias to create the first index and alias if
check_exists: falseandoverwrite: true. If the alias already exists, no new alias will be created, as Elasticsearch will return an error.This change in semantics fixes a setup that has ILM enabled with aforementioned settings, potentially indexing without the appropriate alias/index being setup ahead of time.
Checklist
- [ ] I have commented my code, particularly in hard-to-understand areas- [ ] I have made corresponding changes to the documentation- [ ] I have made corresponding change to the default configuration filesCHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Related issues