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

[7.x] Fix template equals when mappings are wrapped (#77008) #77275

Merged
merged 3 commits into from
Sep 7, 2021

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Sep 3, 2021

Backports the following commits to 7.x:

When create template v2. mappings will add _doc. This will cause the created template to be inconsistent with the queried template.

In template class, add mappingsEquals method, to deal with this case.

reproduced:
MetadataIndexTemplateServiceTests.testAddComponentTemplate
when mappings are not null, the case will failed.

```
        Template template = new Template(
            Settings.builder().build(),
            new CompressedXContent("{\"properties\":{\"@timestamp\":{\"type\":\"date\"}}}"),
            ComponentTemplateTests.randomAliases()
        );
        ComponentTemplate componentTemplate = new ComponentTemplate(template, 1L, new HashMap<>());
```

Co-authored-by: Elastic Machine <[email protected]>
# Conflicts:
#	server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateServiceTests.java
@dakrone dakrone added backport :Data Management/Indices APIs APIs to create and manage indices and templates auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) v7.16.0 labels Sep 3, 2021
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Sep 3, 2021
@elasticmachine
Copy link
Collaborator

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

@dakrone
Copy link
Member Author

dakrone commented Sep 3, 2021

@elasticmachine update branch

@dakrone
Copy link
Member Author

dakrone commented Sep 7, 2021

@elasticmachine update branch

@elasticsearchmachine elasticsearchmachine merged commit 17bf459 into elastic:7.x Sep 7, 2021
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!) backport :Data Management/Indices APIs APIs to create and manage indices and templates Team:Data Management Meta label for data/management team v7.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants