Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't ignore empty index template that have no template definition. #98840

Merged

Conversation

martijnvg
Copy link
Member

A composable index template with no template defined in the body is mistakingly always assumed to not be a time series template. Even if it refers to a component template that has the index.mode setting set to time_series and the component template defines mappings with dimension fields or routing paths.

Closes #98834

A composable index template with no template defined in the body is mistakingly always assumed to not be a time series template. Even if it refers to a component template that has the `index.mode` setting set to `time_series` and the component template defines mappings with dimension fields or routing paths.

Closes elastic#98834
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Aug 24, 2023
@elasticsearchmachine
Copy link
Collaborator

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

"dynamic_templates": [
{
"labels": {
"path_match": "pod.labels.*",
Copy link
Contributor

Choose a reason for hiding this comment

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

is this matching something?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just copied the template part from the index template at the top of this source file.
I think it is based on mapping used in tsdb Rally track.

Copy link
Member Author

Choose a reason for hiding this comment

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

I will remove the dynamic mapping here. No data gets actually indexed in this test.

}
// Settings in composable index template:
{
var componentTemplate = new ComponentTemplate(new Template(null, null, null), null, null);
Copy link
Contributor

Choose a reason for hiding this comment

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

From the code it looks to me the template (as a whole object) is expected to be not null even if it is not enforced with something like Objects.requireNotNull(...), for instance in the ComponentTemplate constructor, while a template with all null fields is allowed. Should we require that the template in ComponentTemplate is not null using an Objects.requireNotNull(...)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Should we require that the template in ComponentTemplate is not null using an Objects.requireNotNull(...)?

👍

Copy link
Member Author

Choose a reason for hiding this comment

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

I will change this in another PR. It could require changes in other places as well.

@salvatore-campagna
Copy link
Contributor

I left two comments but I think the rest is ok...we just prevent early exit if template is null.

@martijnvg martijnvg added the test-full-bwc Trigger full BWC version matrix tests label Aug 25, 2023
@martijnvg martijnvg added the auto-backport Automatically create backport pull requests when merged label Aug 25, 2023
@martijnvg
Copy link
Member Author

Unrelated failure: #98863

@martijnvg
Copy link
Member Author

@elasticmachine run elasticsearch-ci/part-2

@martijnvg martijnvg removed the v8.9.3 label Sep 4, 2023
@martijnvg martijnvg merged commit 0eb2181 into elastic:main Sep 6, 2023
13 checks passed
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.10

martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Sep 6, 2023
…lastic#98840)

A composable index template with no template defined in the body is mistakingly always assumed to not be a time series template. Even if it refers to a component template that has the index.mode setting set to time_series and the component template defines mappings with dimension fields or routing paths.

Closes elastic#98834
alex-spies pushed a commit to dreamquster/elasticsearch that referenced this pull request Sep 8, 2023
…lastic#98840)

A composable index template with no template defined in the body is mistakingly always assumed to not be a time series template. Even if it refers to a component template that has the index.mode setting set to time_series and the component template defines mappings with dimension fields or routing paths.

Closes elastic#98834
dej611 added a commit to elastic/kibana that referenced this pull request Sep 8, 2023
## Summary

Fixes #163971 finally.

This PR keep tracks of ES fix for the TSDB downsampling and will be
ready to restore the tests once the bug has been fixed.

The issue has been fixed with
elastic/elasticsearch#98840 on ES side.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 8, 2023
## Summary

Fixes elastic#163971 finally.

This PR keep tracks of ES fix for the TSDB downsampling and will be
ready to restore the tests once the bug has been fixed.

The issue has been fixed with
elastic/elasticsearch#98840 on ES side.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit 3aa9d7b)
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 :StorageEngine/TSDB You know, for Metrics Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) test-full-bwc Trigger full BWC version matrix tests v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle index template with no template defined correctly
5 participants