Skip to content

Conversation

@masseyke
Copy link
Member

This fixes an edge case introduced by #137407. If a data stream is created with the standard index_mode, and then the template changes the mode to time_series without a routing_path and the data stream is not rolled over, then the get data stream API and the get data stream mappings API will fail with errors mentioning something like failed to apply settings java.lang.IllegalArgumentException: [index.mode=time_series] requires a non-empty [index.routing_path]. Below is an example stack trace:

[2025-11-10T12:51:39,973][WARN ][o.e.c.s.IndexScopedSettings] [runTask-0] [.ds-quickstart-2-2025.11.10-000001] failed to apply settings java.lang.IllegalArgumentException: [index.mode=time_series] requires a non-empty [index.routing_path]
        at [email protected]/org.elasticsearch.index.IndexMode$2.validateWithOtherSettings(IndexMode.java:156)
        at [email protected]/org.elasticsearch.index.IndexSettings$3.validate(IndexSettings.java:751)
        at [email protected]/org.elasticsearch.index.IndexSettings$3.validate(IndexSettings.java:745)
        at [email protected]/org.elasticsearch.common.settings.Setting.get(Setting.java:589)
        at [email protected]/org.elasticsearch.common.settings.Setting.get(Setting.java:561)
        at [email protected]/org.elasticsearch.index.mapper.MapperService.lambda$static$0(MapperService.java:134)
        at [email protected]/org.elasticsearch.common.settings.Setting.innerGetRaw(Setting.java:657)
        at [email protected]/org.elasticsearch.common.settings.Setting.getRaw(Setting.java:632)
        at [email protected]/org.elasticsearch.common.settings.Setting$Updater.hasChanged(Setting.java:1317)
        at [email protected]/org.elasticsearch.common.settings.AbstractScopedSettings$SettingUpdater.updater(AbstractScopedSettings.java:683)
        at [email protected]/org.elasticsearch.common.settings.AbstractScopedSettings.applySettings(AbstractScopedSettings.java:168)
        at [email protected]/org.elasticsearch.index.IndexSettings.updateIndexMetadata(IndexSettings.java:1495)
        at [email protected]/org.elasticsearch.cluster.metadata.DataStream.lambda$getEffectiveMappings$1(DataStream.java:520)
        at [email protected]/org.elasticsearch.indices.IndicesService.withTempIndexService(IndicesService.java:773)
        at [email protected]/org.elasticsearch.cluster.metadata.DataStream.getEffectiveMappings(DataStream.java:495)
        at [email protected]/org.elasticsearch.cluster.metadata.MetadataDataStreamsService.getEffectiveSettings(MetadataDataStreamsService.java:612)
        at [email protected]/org.elasticsearch.cluster.metadata.MetadataDataStreamsService.getEffectiveSettings(MetadataDataStreamsService.java:593)
        at [email protected]/org.elasticsearch.datastreams.action.TransportGetDataStreamsAction.innerOperation(TransportGetDataStreamsAction.java:283)
        at [email protected]/org.elasticsearch.datastreams.action.TransportGetDataStreamsAction.localClusterStateOperation(TransportGetDataStreamsAction.java:179)
        at [email protected]/org.elasticsearch.datastreams.action.TransportGetDataStreamsAction.localClusterStateOperation(TransportGetDataStreamsAction.java:72)
        at [email protected]/org.elasticsearch.action.support.local.TransportLocalProjectMetadataAction.localClusterStateOperation(TransportLocalProjectMetadataAction.java:59)
        at [email protected]/org.elasticsearch.action.support.local.TransportLocalClusterStateAction.lambda$innerDoExecute$0(TransportLocalClusterStateAction.java:92)
        at [email protected]/org.elasticsearch.action.ActionRunnable$4.doRun(ActionRunnable.java:101)
        at [email protected]/org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:1076)
        at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:27)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
        at java.base/java.lang.Thread.run(Thread.java:1474)

@masseyke masseyke requested a review from dakrone November 10, 2025 21:58
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Nov 10, 2025
@masseyke masseyke requested a review from lukewhiting November 10, 2025 21:58
@masseyke masseyke added :Data Management/Data streams Data streams and their lifecycles and removed needs:triage Requires assignment of a team area label labels Nov 10, 2025
@elasticsearchmachine
Copy link
Collaborator

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

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

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

@dakrone dakrone changed the title Fixing geta data stream API when data stream index mode has been changed to time_series Fixing get data stream API when data stream index mode has been changed to time_series Nov 10, 2025
Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

LGTM, I left one comment about a typo

@masseyke
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
9.2

Questions ?

Please refer to the Backport tool documentation

masseyke added a commit to masseyke/elasticsearch that referenced this pull request Nov 11, 2025
…ed to time_series (elastic#137852)

This fixes an edge case introduced by elastic#137407. If a data stream is
created with the standard `index_mode`, and then the template changes
the mode to `time_series` without a `routing_path` and the data stream
is not rolled over, then the get data stream API and the get data stream
mappings API will fail with errors mentioning something like `failed to
apply settings java.lang.IllegalArgumentException:
[index.mode=time_series] requires a non-empty [index.routing_path]`.
Below is an example stack trace:

```
[2025-11-10T12:51:39,973][WARN ][o.e.c.s.IndexScopedSettings] [runTask-0] [.ds-quickstart-2-2025.11.10-000001] failed to apply settings java.lang.IllegalArgumentException: [index.mode=time_series] requires a non-empty [index.routing_path]
        at [email protected]/org.elasticsearch.index.IndexMode$2.validateWithOtherSettings(IndexMode.java:156)
        at [email protected]/org.elasticsearch.index.IndexSettings$3.validate(IndexSettings.java:751)
        at [email protected]/org.elasticsearch.index.IndexSettings$3.validate(IndexSettings.java:745)
        at [email protected]/org.elasticsearch.common.settings.Setting.get(Setting.java:589)
        at [email protected]/org.elasticsearch.common.settings.Setting.get(Setting.java:561)
        at [email protected]/org.elasticsearch.index.mapper.MapperService.lambda$static$0(MapperService.java:134)
        at [email protected]/org.elasticsearch.common.settings.Setting.innerGetRaw(Setting.java:657)
        at [email protected]/org.elasticsearch.common.settings.Setting.getRaw(Setting.java:632)
        at [email protected]/org.elasticsearch.common.settings.Setting$Updater.hasChanged(Setting.java:1317)
        at [email protected]/org.elasticsearch.common.settings.AbstractScopedSettings$SettingUpdater.updater(AbstractScopedSettings.java:683)
        at [email protected]/org.elasticsearch.common.settings.AbstractScopedSettings.applySettings(AbstractScopedSettings.java:168)
        at [email protected]/org.elasticsearch.index.IndexSettings.updateIndexMetadata(IndexSettings.java:1495)
        at [email protected]/org.elasticsearch.cluster.metadata.DataStream.lambda$getEffectiveMappings$1(DataStream.java:520)
        at [email protected]/org.elasticsearch.indices.IndicesService.withTempIndexService(IndicesService.java:773)
        at [email protected]/org.elasticsearch.cluster.metadata.DataStream.getEffectiveMappings(DataStream.java:495)
        at [email protected]/org.elasticsearch.cluster.metadata.MetadataDataStreamsService.getEffectiveSettings(MetadataDataStreamsService.java:612)
        at [email protected]/org.elasticsearch.cluster.metadata.MetadataDataStreamsService.getEffectiveSettings(MetadataDataStreamsService.java:593)
        at [email protected]/org.elasticsearch.datastreams.action.TransportGetDataStreamsAction.innerOperation(TransportGetDataStreamsAction.java:283)
        at [email protected]/org.elasticsearch.datastreams.action.TransportGetDataStreamsAction.localClusterStateOperation(TransportGetDataStreamsAction.java:179)
        at [email protected]/org.elasticsearch.datastreams.action.TransportGetDataStreamsAction.localClusterStateOperation(TransportGetDataStreamsAction.java:72)
        at [email protected]/org.elasticsearch.action.support.local.TransportLocalProjectMetadataAction.localClusterStateOperation(TransportLocalProjectMetadataAction.java:59)
        at [email protected]/org.elasticsearch.action.support.local.TransportLocalClusterStateAction.lambda$innerDoExecute$0(TransportLocalClusterStateAction.java:92)
        at [email protected]/org.elasticsearch.action.ActionRunnable$4.doRun(ActionRunnable.java:101)
        at [email protected]/org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:1076)
        at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:27)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
        at java.base/java.lang.Thread.run(Thread.java:1474)
```

(cherry picked from commit f2afb88)
elasticsearchmachine pushed a commit that referenced this pull request Nov 11, 2025
…ed to time_series (#137852) (#137898)

This fixes an edge case introduced by #137407. If a data stream is
created with the standard `index_mode`, and then the template changes
the mode to `time_series` without a `routing_path` and the data stream
is not rolled over, then the get data stream API and the get data stream
mappings API will fail with errors mentioning something like `failed to
apply settings java.lang.IllegalArgumentException:
[index.mode=time_series] requires a non-empty [index.routing_path]`.
Below is an example stack trace:

```
[2025-11-10T12:51:39,973][WARN ][o.e.c.s.IndexScopedSettings] [runTask-0] [.ds-quickstart-2-2025.11.10-000001] failed to apply settings java.lang.IllegalArgumentException: [index.mode=time_series] requires a non-empty [index.routing_path]
        at [email protected]/org.elasticsearch.index.IndexMode$2.validateWithOtherSettings(IndexMode.java:156)
        at [email protected]/org.elasticsearch.index.IndexSettings$3.validate(IndexSettings.java:751)
        at [email protected]/org.elasticsearch.index.IndexSettings$3.validate(IndexSettings.java:745)
        at [email protected]/org.elasticsearch.common.settings.Setting.get(Setting.java:589)
        at [email protected]/org.elasticsearch.common.settings.Setting.get(Setting.java:561)
        at [email protected]/org.elasticsearch.index.mapper.MapperService.lambda$static$0(MapperService.java:134)
        at [email protected]/org.elasticsearch.common.settings.Setting.innerGetRaw(Setting.java:657)
        at [email protected]/org.elasticsearch.common.settings.Setting.getRaw(Setting.java:632)
        at [email protected]/org.elasticsearch.common.settings.Setting$Updater.hasChanged(Setting.java:1317)
        at [email protected]/org.elasticsearch.common.settings.AbstractScopedSettings$SettingUpdater.updater(AbstractScopedSettings.java:683)
        at [email protected]/org.elasticsearch.common.settings.AbstractScopedSettings.applySettings(AbstractScopedSettings.java:168)
        at [email protected]/org.elasticsearch.index.IndexSettings.updateIndexMetadata(IndexSettings.java:1495)
        at [email protected]/org.elasticsearch.cluster.metadata.DataStream.lambda$getEffectiveMappings$1(DataStream.java:520)
        at [email protected]/org.elasticsearch.indices.IndicesService.withTempIndexService(IndicesService.java:773)
        at [email protected]/org.elasticsearch.cluster.metadata.DataStream.getEffectiveMappings(DataStream.java:495)
        at [email protected]/org.elasticsearch.cluster.metadata.MetadataDataStreamsService.getEffectiveSettings(MetadataDataStreamsService.java:612)
        at [email protected]/org.elasticsearch.cluster.metadata.MetadataDataStreamsService.getEffectiveSettings(MetadataDataStreamsService.java:593)
        at [email protected]/org.elasticsearch.datastreams.action.TransportGetDataStreamsAction.innerOperation(TransportGetDataStreamsAction.java:283)
        at [email protected]/org.elasticsearch.datastreams.action.TransportGetDataStreamsAction.localClusterStateOperation(TransportGetDataStreamsAction.java:179)
        at [email protected]/org.elasticsearch.datastreams.action.TransportGetDataStreamsAction.localClusterStateOperation(TransportGetDataStreamsAction.java:72)
        at [email protected]/org.elasticsearch.action.support.local.TransportLocalProjectMetadataAction.localClusterStateOperation(TransportLocalProjectMetadataAction.java:59)
        at [email protected]/org.elasticsearch.action.support.local.TransportLocalClusterStateAction.lambda$innerDoExecute$0(TransportLocalClusterStateAction.java:92)
        at [email protected]/org.elasticsearch.action.ActionRunnable$4.doRun(ActionRunnable.java:101)
        at [email protected]/org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:1076)
        at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:27)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
        at java.base/java.lang.Thread.run(Thread.java:1474)
```

(cherry picked from commit f2afb88)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >bug :Data Management/Data streams Data streams and their lifecycles Team:Data Management Meta label for data/management team v9.2.2 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants