Skip to content

Conversation

@masseyke
Copy link
Member

@masseyke masseyke commented Aug 12, 2025

This adds the ability to set index.number_of_replicas in the data stream settings API. Unlike any other settings we support, this one applies to the write index (and any future indices) only. It does not apply to other backing indices.
It also adds a new section to the response of the put data streams settings API. That API will now include a applied_to_data_stream_and_write_index array, alongside the previously-existing applied_to_data_stream_only and applied_to_data_stream_and_backing_indices arrays.

@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Aug 12, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@masseyke masseyke requested a review from Copilot August 19, 2025 16:14
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 adds support for configuring index.number_of_replicas in the data stream settings API, with the unique behavior of applying only to the write index and future indices. It introduces a new response section to distinguish settings that apply to different scopes of backing indices.

  • Adds index.number_of_replicas as a write-index-only setting
  • Introduces a new response array applied_to_data_stream_and_write_indices in the API response
  • Updates serialization to handle backward compatibility with the new field

Reviewed Changes

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

Show a summary per file
File Description
TransportUpdateDataStreamSettingsAction.java Implements the core logic for write-index-only settings and differentiates between write and non-write indices
UpdateDataStreamSettingsAction.java Updates the response structure and serialization to include the new applied_to_data_stream_and_write_indices field
TransportVersions.java Adds version constant for backward compatibility
UpdateDataStreamSettingsActionResponseTests.java Updates test to cover the new response field
240_data_stream_settings.yml Adds integration test for the new write-index-only setting behavior

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

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.

LGTM 👍🏻

@masseyke masseyke merged commit e1c2760 into elastic:main Aug 20, 2025
34 checks passed
@masseyke masseyke deleted the data-stream-settings-index_number_of_replicas branch August 20, 2025 13:34
szybia added a commit to szybia/elasticsearch that referenced this pull request Aug 20, 2025
…improv

* upstream/main: (58 commits)
  Fixing flaky LoggedExec (tests) (elastic#133215)
  CPS search should not use `skip_unavailable` (elastic#132927)
  Don't fail search if bottom doc can't be formatted (elastic#133188)
  Mute org.elasticsearch.xpack.esql.action.RandomizedTimeSeriesIT testGroupByNothing elastic#133225
  Mute org.elasticsearch.index.codec.tsdb.es819.ES819TSDBDocValuesFormatTests testSortedSetDocValuesWithSkipperSmall elastic#133224
  Mute org.elasticsearch.index.codec.tsdb.es819.ES819TSDBDocValuesFormatTests testSortedNumberMergeAwayAllValuesWithSkipper elastic#133223
  Adding support for index.number_of_replicas to data stream settings (elastic#132748)
  Mute org.elasticsearch.index.codec.tsdb.es819.ES819TSDBDocValuesFormatTests testSortedDocValuesSingleUniqueValue elastic#133221
  Fix VectorSimilarityFunctionsIT (elastic#133206)
  Mute org.elasticsearch.xpack.esql.action.RandomizedTimeSeriesIT testGroupBySubset elastic#133220
  Increase the number of FORK branches in ForkGenerator (elastic#132019)
  Mute org.elasticsearch.index.mapper.blockloader.IpFieldBlockLoaderTests testBlockLoader {preference=Params[syntheticSource=true, preference=STORED]} elastic#133218
  Mute org.elasticsearch.index.mapper.blockloader.IpFieldBlockLoaderTests testBlockLoader {preference=Params[syntheticSource=true, preference=DOC_VALUES]} elastic#133217
  Mute org.elasticsearch.index.mapper.blockloader.IpFieldBlockLoaderTests testBlockLoader {preference=Params[syntheticSource=true, preference=NONE]} elastic#133216
  Set default processor allocation for test clusters (elastic#133204)
  Add mapper for exponential histograms (elastic#132493)
  Fix offset handling in Murmur3Hasher (elastic#133193)
  unmute testDoesNotResolveClosedIndex (elastic#133115)
  Fix an AWS SDK v2 release note (elastic#133155)
  Limit the depth of a filter (elastic#133113)
  ...
szybia added a commit to szybia/elasticsearch that referenced this pull request Aug 20, 2025
* upstream/main: (58 commits)
  Fixing flaky LoggedExec (tests) (elastic#133215)
  CPS search should not use `skip_unavailable` (elastic#132927)
  Don't fail search if bottom doc can't be formatted (elastic#133188)
  Mute org.elasticsearch.xpack.esql.action.RandomizedTimeSeriesIT testGroupByNothing elastic#133225
  Mute org.elasticsearch.index.codec.tsdb.es819.ES819TSDBDocValuesFormatTests testSortedSetDocValuesWithSkipperSmall elastic#133224
  Mute org.elasticsearch.index.codec.tsdb.es819.ES819TSDBDocValuesFormatTests testSortedNumberMergeAwayAllValuesWithSkipper elastic#133223
  Adding support for index.number_of_replicas to data stream settings (elastic#132748)
  Mute org.elasticsearch.index.codec.tsdb.es819.ES819TSDBDocValuesFormatTests testSortedDocValuesSingleUniqueValue elastic#133221
  Fix VectorSimilarityFunctionsIT (elastic#133206)
  Mute org.elasticsearch.xpack.esql.action.RandomizedTimeSeriesIT testGroupBySubset elastic#133220
  Increase the number of FORK branches in ForkGenerator (elastic#132019)
  Mute org.elasticsearch.index.mapper.blockloader.IpFieldBlockLoaderTests testBlockLoader {preference=Params[syntheticSource=true, preference=STORED]} elastic#133218
  Mute org.elasticsearch.index.mapper.blockloader.IpFieldBlockLoaderTests testBlockLoader {preference=Params[syntheticSource=true, preference=DOC_VALUES]} elastic#133217
  Mute org.elasticsearch.index.mapper.blockloader.IpFieldBlockLoaderTests testBlockLoader {preference=Params[syntheticSource=true, preference=NONE]} elastic#133216
  Set default processor allocation for test clusters (elastic#133204)
  Add mapper for exponential histograms (elastic#132493)
  Fix offset handling in Murmur3Hasher (elastic#133193)
  unmute testDoesNotResolveClosedIndex (elastic#133115)
  Fix an AWS SDK v2 release note (elastic#133155)
  Limit the depth of a filter (elastic#133113)
  ...
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 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants