Skip to content

Conversation

@leontyevdv
Copy link
Contributor

A few explicit tests for TS queries covering counter rate and agg_over_time, in a multi-cluster setup.

The strategy of testing is the following:

  • To index test data into two clusters (hosts*)
  • To index the same data into a single-cluster index.
  • Request both and compare result.

Add MultiClusterTimeSeriesIT to make sure that the TS command works
correctly in the multi-cluster environment.

Closes elastic#135218
@leontyevdv leontyevdv requested review from a team and dnhatn October 28, 2025 09:47
@leontyevdv leontyevdv self-assigned this Oct 28, 2025
@leontyevdv leontyevdv added >test Issues or PRs that are addressing/adding tests :StorageEngine/TSDB You know, for Metrics Team:StorageEngine :StorageEngine/ES|QL Timeseries / metrics / logsdb capabilities in ES|QL v9.3.0 labels Oct 28, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

Add MultiClusterTimeSeriesIT to make sure that the TS command works
correctly in the multi-cluster environment.

Closes elastic#135218
Add MultiClusterTimeSeriesIT to make sure that the TS command works
correctly in the multi-cluster environment.

Closes elastic#135218
Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

One question, but this looks great. Thanks Dima!

}

protected boolean supportsAsync() {
return false;
Copy link
Member

Choose a reason for hiding this comment

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

Why do we always need to disable async?

Copy link
Contributor Author

@leontyevdv leontyevdv Oct 29, 2025

Choose a reason for hiding this comment

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

Yeah, I took it from the existing code, particularly from MultiClustersIT.java#L207. Reading the comment, I thought we could use async here and changed it to use the randomBoolean() method. When it's true it fails with the following exception:

MultiClusterTimeSeriesIT > testAvgOverTime FAILED
    org.elasticsearch.xcontent.XContentGenerationException: com.fasterxml.jackson.core.JsonGenerationException: Can not write a field name, expecting a value
        at __randomizedtesting.SeedInfo.seed([2602953138915D1E:D6848838FA018932]:0)
        at org.elasticsearch.xcontent.provider.json.JsonXContentGenerator.writeFieldName(JsonXContentGenerator.java:190)
        at app//org.elasticsearch.xcontent.XContentBuilder.field(XContentBuilder.java:373)
        at app//org.elasticsearch.xcontent.XContentBuilder.field(XContentBuilder.java:890)
        at app//org.elasticsearch.xpack.esql.qa.rest.RestEsqlTestCase$RequestObjectBuilder.waitForCompletion(RestEsqlTestCase.java:180)
        at app//org.elasticsearch.xpack.esql.qa.rest.RestEsqlTestCase.addAsyncParameters(RestEsqlTestCase.java:1827)
        at app//org.elasticsearch.xpack.esql.qa.rest.RestEsqlTestCase.runEsqlAsync(RestEsqlTestCase.java:1540)
        at app//org.elasticsearch.xpack.esql.qa.rest.RestEsqlTestCase.runEsqlAsync(RestEsqlTestCase.java:1529)
        at app//org.elasticsearch.xpack.esql.ccq.MultiClusterTimeSeriesIT.runEsql(MultiClusterTimeSeriesIT.java:295)
        at app//org.elasticsearch.xpack.esql.ccq.MultiClusterTimeSeriesIT.run(MultiClusterTimeSeriesIT.java:284)
        at app//org.elasticsearch.xpack.esql.ccq.MultiClusterTimeSeriesIT.testAvgOverTime(MultiClusterTimeSeriesIT.java:192)

        Caused by:
        com.fasterxml.jackson.core.JsonGenerationException: Can not write a field name, expecting a value
            at com.fasterxml.jackson.core.JsonGenerator._constructWriteException(JsonGenerator.java:2884)
            at com.fasterxml.jackson.core.JsonGenerator._reportError(JsonGenerator.java:2868)
            at com.fasterxml.jackson.dataformat.cbor.CBORGenerator.writeFieldName(CBORGenerator.java:528)
            at org.elasticsearch.xcontent.provider.json.JsonXContentGenerator.writeFieldName(JsonXContentGenerator.java:188)
            ... 9 more

Will double-check this.

@leontyevdv leontyevdv merged commit 4a7db66 into elastic:main Oct 30, 2025
34 checks passed
chrisparrinello pushed a commit to chrisparrinello/elasticsearch that referenced this pull request Nov 3, 2025
* [TEST] Add MultiClusterTimeSeriesIT

Add MultiClusterTimeSeriesIT to make sure that the TS command works
correctly in the multi-cluster environment.

Closes elastic#135218
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:StorageEngine/ES|QL Timeseries / metrics / logsdb capabilities in ES|QL :StorageEngine/TSDB You know, for Metrics Team:StorageEngine >test Issues or PRs that are addressing/adding tests v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants