-
Notifications
You must be signed in to change notification settings - Fork 25.2k
[DLM] Introduce default rollover cluster setting & expose it via APIs #94240
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
Conversation
Pinging @elastic/es-data-management (Team:Data Management) |
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 working on this Mary
This looks great, I left some minor suggestions
modules/dlm/src/main/java/org/elasticsearch/dlm/DataLifecycleService.java
Show resolved
Hide resolved
rest-api-spec/src/main/resources/rest-api-spec/api/cluster.get_component_template.json
Outdated
Show resolved
Hide resolved
...org/elasticsearch/action/admin/indices/template/get/TransportGetComponentTemplateAction.java
Outdated
Show resolved
Hide resolved
...asticsearch/action/admin/indices/template/get/TransportGetComposableIndexTemplateAction.java
Outdated
Show resolved
Hide resolved
...va/org/elasticsearch/action/admin/indices/template/get/GetComposableIndexTemplateAction.java
Show resolved
Hide resolved
...va/org/elasticsearch/action/admin/indices/template/get/GetComposableIndexTemplateAction.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/datastreams/GetDataStreamAction.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/datastreams/GetDataStreamAction.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverConditions.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverConditions.java
Outdated
Show resolved
Hide resolved
Thanks for the prompt review @andreidan . Along with implementing the feedback from your review I added a test for setting parser in |
Hi @gmarouli, I've created a changelog YAML for you. |
Ignore the comment above ^^.... The test was at a different class..... face_palm fixing it |
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 iterating on this Mary
Left a few minor suggestions, but this is almost ready to go 🚀
server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverConditions.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverConditions.java
Show resolved
Hide resolved
* We require the default rollover conditions to have min_docs set to a non-negative number to avoid empty indices | ||
* and to have at least one MAX condition set to ensure that the rollover will be triggered. | ||
*/ | ||
static class RolloverConditionsValidator implements Setting.Validator<RolloverConditions> { |
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'm in two minds about this validator.
The setting is meant to allow us to make changes, it'll not be something the users will configure.
I'm tempted to say we shouldn't add this validation, but only validate that the setting is not empty (which should be covered by the RolloverConditions.parseSetting
? )
What do you think?
Note: If we do keep it I think it shouldn't be restricted to min_docs
. The are other min_*
conditions that could be valid to avoid rolling over empty indices
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 setting is meant to allow us to make changes, it'll not be something the users will configure.
That is true, but I think even we can make a mistake, so avoiding creating empty indices is a safe bet. I see this validation helping the us not blocking us.
If we do keep it I think it shouldn't be restricted to min_docs. The are other min_* conditions that could be valid to avoid rolling over empty indices
That is true, I did consider it but I had some concerns about the following:
min_age
doesn't protect us from empty indices, you can have an index that has been there for 7 days and it can still be empty.min_size
&min_primary_shard_size
concerns me because an index doesn't have an empty footprint so if you set it up wrongly you might still have an empty index (if I am not mistaken).min_primary_shard_docs
I think is a good addition :).
I would suggest that we keep the validation but we add the min_primary_shard_docs
as an option too. What do you think? I am thinking that there are no use cases that would not want at least one of the two.
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.
Discussed offline. We will remove the checks for min_*
conditions.
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 the whole validator could be removed and leave the RolloverConditions#parser to make sure there's at least one condition, regardless what that is.
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.
Opened #94447
@elasticmachine run elasticsearch-ci/part-1, I believe the failure is related (#94281) I have contacted the @HiDAl to verify the assumption and fix it. |
In this PR we are introducing the following:
include_defaults
forGET /data_streams
,GET /_index_template
andGET /_component_template
, this will expose default configuration related to these endpoints.include_defaults
parameter is true in the above endpoints
Part of: #93596
Docs preview: