Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -325,20 +325,16 @@ public void testTsdbTemplatesNoKeywordFieldType() throws Exception {
}
}""";
var request = new TransportPutComposableIndexTemplateAction.Request("id");
Settings.Builder settingsBuilder = Settings.builder()
.put("index.mode", "time_series")
.put("index.dimensions_tsid_strategy_enabled", randomDouble() < 0.8);
if (randomBoolean()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this also be always set when the setting above is false?

Copy link
Contributor

@kkrik-es kkrik-es Oct 6, 2025

Choose a reason for hiding this comment

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

I'd simply fix as:

boolean dimensions_tsid_strategy_enabled = randomDouble() < 0.8;
...
          .put("index.routing_path", dimensions_tsid_strategy_enabled || randomBoolean() ? "metricset" : null)
          .put("index.dimensions_tsid_strategy_enabled", dimensions_tsid_strategy_enabled)

Copy link
Member Author

Choose a reason for hiding this comment

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

Shouldn't this also be always set when the setting above is false?

No, even if index.dimensions_tsid_strategy_enabled is false, the routing_path doesn't need to be set explicitly as this is a data stream template, for which the routing_path will be automatically determined if unset. I explicitly want to test all four permutations of strategy enabled true/false and routing path set/unset. Also, routing path unset is different to routing path explicitly set to null. This triggered the test failure in the first place. It's a bit surprising but not sure if it's worth changing. At least not in this PR.

As both explicitly setting index.routing_path as well setting index.dimensions_tsid_strategy_enable to false disables the new index.dimensions-based tsid strategy, I wanted to give disabling that strategy a lower probability with via randomDouble() < 0.8.

Copy link
Member Author

Choose a reason for hiding this comment

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

Note that I also ran this locally with 500 iterations and all have succeeded.

settingsBuilder.put("index.routing_path", "metricset");
}
request.indexTemplate(
ComposableIndexTemplate.builder()
.indexPatterns(List.of("k8s*"))
.template(
new Template(
Settings.builder()
.put("index.mode", "time_series")
.put("index.routing_path", randomBoolean() ? null : "metricset")
.put("index.dimensions_tsid_strategy_enabled", randomDouble() < 0.8)
.build(),
new CompressedXContent(mappingTemplate),
null
)
)
.template(new Template(settingsBuilder.build(), new CompressedXContent(mappingTemplate), null))
.dataStreamTemplate(new ComposableIndexTemplate.DataStreamTemplate(false, false))
.build()
);
Expand Down
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,6 @@ tests:
- class: org.elasticsearch.indices.recovery.IndexRecoveryIT
method: testUsesFileBasedRecoveryIfOperationsBasedRecoveryWouldBeUnreasonable
issue: https://github.com/elastic/elasticsearch/issues/135737
- class: org.elasticsearch.datastreams.TSDBIndexingIT
method: testTsdbTemplatesNoKeywordFieldType
issue: https://github.com/elastic/elasticsearch/issues/135746
- class: org.elasticsearch.xpack.esql.expression.function.aggregate.IncreaseTests
method: testGroupingAggregate {TestCase=<small positive doubles>}
issue: https://github.com/elastic/elasticsearch/issues/135752
Expand Down