-
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
Refactor data stream lifecycle to use the template paradigm #124593
Refactor data stream lifecycle to use the template paradigm #124593
Conversation
Pinging @elastic/es-data-management (Team:Data Management) |
I will work on the CI in the meantime, but I wanted to open it already for a review because it's quite a big. |
} | ||
|
||
private final boolean enabled; |
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 have been going back and forth about this one, should we keep it boolean
or should we convert it to Boolean
.
When it comes to failure store we had a specific use case where we enable it via a cluster setting. Here, we do not have such a use case yet, so I am leaning towards keep it as is. Any thoughts?
cc @dakrone
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 keeping it as is until we have a more concrete need for it to change is probably the best approach here.
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!
|| out.getTransportVersion().isPatchFrom(TransportVersions.INTRODUCE_LIFECYCLE_TEMPLATE_8_19)) { | ||
out.writeOptionalTimeValue(dataRetention); | ||
} else { | ||
out.writeBoolean(dataRetention != null); |
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.
You were right, this is indeed somewhat confusing. I understand that we're replicating writing an optional object that was writing an optional field of its own. Maybe we should add some comments to this method to mirror those added in the read method.
💔 Backport failed
You can use sqren/backport to manually backport by running |
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
…124593) (cherry picked from commit ce04da7) # Conflicts: # modules/data-streams/src/main/java/org/elasticsearch/datastreams/lifecycle/action/TransportGetDataStreamLifecycleStatsAction.java # modules/data-streams/src/test/java/org/elasticsearch/datastreams/MetadataIndexTemplateServiceTests.java # modules/data-streams/src/test/java/org/elasticsearch/datastreams/lifecycle/DataStreamLifecycleFixtures.java # server/src/main/java/org/elasticsearch/TransportVersions.java # server/src/main/java/org/elasticsearch/action/admin/indices/template/post/TransportSimulateIndexTemplateAction.java # server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateDataStreamService.java # server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java # server/src/main/java/org/elasticsearch/cluster/metadata/ProjectMetadata.java # server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamTests.java # server/src/test/java/org/elasticsearch/cluster/metadata/MetadataDataStreamsServiceTests.java # server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateServiceTests.java
In this PR we migrate the
DataStreamLifecycle
configuration to the new "template" framework we introduced in #117357. Effectively, we split the code that is used by the data stream and the templates. This is better for the following reasons:ResettableValue
and can be composed easier as well.