Skip to content

[Sampling] Using index setting providers for data stream setting validation#136214

Merged
masseyke merged 8 commits intoelastic:mainfrom
masseyke:data-stream-settings-use-index-setting-providers
Oct 9, 2025
Merged

[Sampling] Using index setting providers for data stream setting validation#136214
masseyke merged 8 commits intoelastic:mainfrom
masseyke:data-stream-settings-use-index-setting-providers

Conversation

@masseyke
Copy link
Member

@masseyke masseyke commented Oct 8, 2025

This accounts for index setting providers when validating settings. This avoids failures that occur when putting settings on a TSDB data stream.
Closes #136166

@masseyke masseyke added >bug :StorageEngine/Data streams Data streams and their lifecycles auto-backport Automatically create backport pull requests when merged v9.2.0 v9.3.0 labels Oct 8, 2025
@masseyke masseyke requested a review from Copilot October 8, 2025 17:58
@elasticsearchmachine
Copy link
Collaborator

Hi @masseyke, I've created a changelog YAML for you.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances data stream setting validation by incorporating index setting providers, specifically to resolve failures when applying settings to TSDB (Time Series Data Base) data streams.

  • Adds IndexSettingProviders parameter to MetadataDataStreamsService constructor and related methods
  • Implements additional settings validation logic that accounts for index setting providers
  • Includes new test coverage for TSDB data stream setting validation

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
MetadataDataStreamsService.java Core implementation adding IndexSettingProviders integration and validation logic
NodeConstruction.java Updates service instantiation to include IndexSettingProviders parameter
MetadataDataStreamsServiceTests.java Updates test mocks to include new IndexSettingProviders parameter
DataStreamLifecycleWithRetentionWarningsTests.java Updates test mocks to include new IndexSettingProviders parameter
DataStreamSettingsIT.java Adds integration test for TSDB data stream settings validation
20_metrics_tests.yml Adds YAML REST test for data stream settings with ILM

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@masseyke masseyke marked this pull request as ready for review October 8, 2025 17:59
@masseyke masseyke requested review from a team as code owners October 8, 2025 17:59
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label Oct 8, 2025
@dakrone dakrone changed the title Using index settng providers for data stream setting validation Oct 8, 2025
Copy link
Member

@felixbarny felixbarny left a comment

Choose a reason for hiding this comment

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

LGTM. Just some nits and a suggestion to avoid code duplication, but that can also be done separately from this bug fix in another PR.

return dataStream.copy().setSettings(mergedDataStreamSettings).build();
}

private Settings addSettingsFromIndexSettingProviders(
Copy link
Member

Choose a reason for hiding this comment

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

This is the fifth place where we're essentially repeating the same logic. Is there a way to avoid the duplication by having a common method that we can call in various places?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I definitely agree. I'll try to do it in a follow-up PR (I don't want to delay getting this bug fixed b/c I think that'll be a fairly invasive change).

Copy link
Member

Choose a reason for hiding this comment

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

Hey Keith, friendly reminder to create a follow up PR to address the duplication.

Copy link
Contributor

@lukewhiting lukewhiting left a comment

Choose a reason for hiding this comment

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

Nothing to add that other's haven't already spotted but in terms of the function and streams, looks like a sensible change that should fix the bug 👍🏻

masseyke and others added 3 commits October 9, 2025 09:01
@masseyke masseyke added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Oct 9, 2025
@masseyke masseyke merged commit ea2fb07 into elastic:main Oct 9, 2025
33 of 34 checks passed
@masseyke masseyke deleted the data-stream-settings-use-index-setting-providers branch October 9, 2025 15:30
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
9.2
masseyke added a commit to masseyke/elasticsearch that referenced this pull request Oct 9, 2025
@masseyke masseyke changed the title Using index setting providers for data stream setting validation Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >bug :StorageEngine/Data streams Data streams and their lifecycles Team:Data Management (obsolete) DO NOT USE. This team no longer exists. v9.2.0 v9.3.0

6 participants