Skip to content

Conversation

@masseyke
Copy link
Member

@masseyke masseyke commented Oct 30, 2025

The method used to get effective settings for a data stream did not take settings from IndexSettingsProviders into account. This caused the get data stream mappings API to crash for time_series data streams since settings were missing.
This PR moves getEffectiveSettings from DataStream to MetadataDataStreamsService, and adds the implicit settings from IndexSettingsProviders to the effective settings.
Closes #137381

@masseyke masseyke added >bug :Data Management/Data streams Data streams and their lifecycles v9.3.0 labels Oct 30, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@masseyke masseyke requested a review from Copilot October 30, 2025 22:08
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 effective settings calculation by incorporating additional settings from index setting providers. Previously, getEffectiveSettings() only considered template and data stream settings, but now it accepts a function parameter to apply implicit settings from index setting providers.

Key changes:

  • Modified DataStream.getEffectiveSettings() to accept a Function<Settings, Settings> parameter for applying additional settings
  • Made MetadataDataStreamsService.addSettingsFromIndexSettingProviders() public and removed throws IOException declaration
  • Updated all callers of getEffectiveSettings() to pass the appropriate function, typically invoking addSettingsFromIndexSettingProviders()

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java Modified getEffectiveSettings() signature to accept a function parameter for applying implicit settings
server/src/main/java/org/elasticsearch/cluster/metadata/MetadataDataStreamsService.java Changed addSettingsFromIndexSettingProviders() visibility to public and removed throws IOException
server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamTests.java Updated test calls to getEffectiveSettings() with identity function settings -> settings
server/src/test/java/org/elasticsearch/action/admin/indices/rollover/MetadataRolloverServiceTests.java Updated test call to getEffectiveSettings() with identity function
modules/data-streams/src/main/java/org/elasticsearch/datastreams/action/TransportGetDataStreamsAction.java Added dependencies and updated to call getEffectiveSettings() with index setting providers function
modules/data-streams/src/main/java/org/elasticsearch/datastreams/action/TransportGetDataStreamSettingsAction.java Added dependencies and updated to call getEffectiveSettings() with index setting providers function
modules/data-streams/src/main/java/org/elasticsearch/datastreams/action/TransportUpdateDataStreamSettingsAction.java Added dependencies and updated to call getEffectiveSettings() with index setting providers function
modules/data-streams/src/test/java/org/elasticsearch/datastreams/action/TransportGetDataStreamsActionTests.java Added mock setup for MetadataDataStreamsService and IndicesService dependencies
docs/changelog/137407.yaml Added changelog entry documenting the bug fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@elasticsearchmachine
Copy link
Collaborator

Hi @masseyke, I've updated the changelog YAML for you.

@masseyke masseyke requested a review from lukewhiting November 3, 2025 23:47
@masseyke masseyke marked this pull request as ready for review November 3, 2025 23:47
@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Nov 3, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@masseyke masseyke added v9.2.1 auto-backport Automatically create backport pull requests when merged labels Nov 3, 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 >bug :Data Management/Data streams Data streams and their lifecycles Team:Data Management Meta label for data/management team v9.2.1 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data stream mappings dry run fails for integration time_series data streams

2 participants