-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
ILM don't rollover empty indices #89557
Merged
joegallo
merged 21 commits into
elastic:main
from
joegallo:ilm-dont-rollover-empty-indices
Sep 19, 2022
Merged
Changes from 18 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
2df4259
Reorder these constants for consistency
joegallo 4e2dbcb
Add indices.lifecycle.rollover.only_if_has_documents
joegallo 571c6a2
Reorder these assertions
joegallo d1e4229
Extract a helper method, DRY
joegallo 0cb7c4b
Extend mockRolloverIndexCall to cover another case
joegallo 35a595b
Add a min_docs: 1 condition to WaitForRolloverReadyStep
joegallo f955cce
Extract createRolloverRequest and add a test
joegallo d18ec07
Update docs/changelog/89557.yaml
joegallo 5ffbef5
Update docs/changelog/89557.yaml
joegallo ed9567b
Tweak this test
joegallo a940cdb
Add a test of the new behavior
joegallo 7232d5d
Merge branch 'main' into ilm-dont-rollover-empty-indices
joegallo 5cd280e
Merge branch 'main' into ilm-dont-rollover-empty-indices
joegallo 041daa0
Add only_if_has_documents to the ilm-settings docs
joegallo 710d89a
Add release highlight
joegallo b6a8073
Update the ILM rollover docs
joegallo 282bbe7
Fix formatting for :validateChangelogs
joegallo 3b9b90e
Merge branch 'main' into ilm-dont-rollover-empty-indices
joegallo b4f780a
Add javadocs for createRolloverRequest
joegallo 1ea80c1
Rewrite the randomized test into three tests
joegallo 70be07a
Merge branch 'main' into ilm-dont-rollover-empty-indices
joegallo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
pr: 89557 | ||
summary: ILM don't rollover empty indices | ||
area: ILM+SLM | ||
type: enhancement | ||
issues: | ||
- 86203 | ||
highlight: | ||
title: ILM no longer rolls over empty indices | ||
body: |- | ||
For both new and existing Index Lifecycle Management (ILM) policies, | ||
the rollover action will only execute if an index has at least one document. | ||
|
||
For indices with a `max_age` condition that are no longer being written | ||
to, this will mean that they will no longer roll over every time their | ||
`max_age` is reached. | ||
|
||
A policy can override this behavior, and explicitly opt in to rolling over | ||
empty indices, by adding a `"min_docs": 0` condition: | ||
|
||
[source,console] | ||
---- | ||
PUT _ilm/policy/allow_empty_rollover_policy | ||
{ | ||
"policy": { | ||
"phases": { | ||
"hot": { | ||
"actions": { | ||
"rollover" : { | ||
"max_age": "7d", | ||
"max_size": "100gb", | ||
"min_docs": 0 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
---- | ||
|
||
This can also be disabled on a cluster-wide basis by setting | ||
`indices.lifecycle.rollover.only_if_has_documents` to `false`. | ||
notable: true |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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'd be even better if this had javadoc, even though it's essentially private :)
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.
Done, b4f780a