Skip to content
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

[Data stream lifecycle]Add warning when the user's retention is not the effective retention #107781

Merged
merged 12 commits into from Apr 26, 2024

Conversation

gmarouli
Copy link
Contributor

We want to inform the user when the retention provided in a data stream or a template is not going to be the effective retention.

We choose not to reject the configuration because:

  • We are more resilient to automated updates
  • If the global retention changes the user's configuration can become effective
    Additionally, we add a warning header to inform the user about the effective retention.

@gmarouli gmarouli marked this pull request as ready for review April 24, 2024 11:20
@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Apr 24, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)


DataStreamLifecycle noRetentionLifecycle = DataStreamLifecycle.newBuilder().downsampling(randomDownsampling()).build();
DataStreamGlobalRetention globalRetention = new DataStreamGlobalRetention(
randomTimeValue(2, 10, TimeUnit.DAYS),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extremely minor nit: you sometimes use randomTimeValue(2, 10, TimeUnit.DAYS) and sometimes TimeValue.timeValueDays(randomIntBetween(5, 100)). I think it wouldn't hurt to stick to one for consistency's sake :). The former is slightly shorter than the latter, so maybe I have the tiniest preference for that, but I'll let it up to you 😉.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, and it's not an inconsistency, just trying to keep the PR manageable. randomTimeValue(2, 10, TimeUnit.DAYS) was recently introduced, so I use it now in the code I touch. Then in a separate PR I will change it because otherwise we are going to touch many other files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay that makes sense. I did notice one in this PR here, that's the only reason I mentioned it :).

@gmarouli gmarouli requested a review from a team as a code owner April 25, 2024 10:53
Copy link
Contributor

@nielsbauman nielsbauman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the iterations Mary :)

Copy link
Member

@thecoop thecoop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

construction changes look good

@gmarouli
Copy link
Contributor Author

@elasticmachine update branch

@gmarouli
Copy link
Contributor Author

@elasticmachine update branch

Copy link
Contributor

@parkertimmins parkertimmins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@gmarouli
Copy link
Contributor Author

@elasticmachine update branch

@gmarouli gmarouli merged commit a6a29d0 into elastic:main Apr 26, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Data streams Data streams and their lifecycles >non-issue Team:Data Management Meta label for data/management team v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants