Fix template equals when mappings are wrapped#77008
Merged
dakrone merged 6 commits intoelastic:masterfrom Sep 3, 2021
Merged
Conversation
Contributor
Author
|
hi, @dakrone, @martijnvg , can you help to review this PR? |
Collaborator
|
Pinging @elastic/es-data-management (Team:Data Management) |
Member
|
@elasticmachine ok to test |
Member
|
@elasticmachine update branch |
Member
|
@elasticmachine update branch |
Member
|
Thanks for fixing this @weizijun! I'll backport this to 7.x. |
dakrone
pushed a commit
to dakrone/elasticsearch
that referenced
this pull request
Sep 3, 2021
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 <elasticmachine@users.noreply.github.com>
# Conflicts:
# server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateServiceTests.java
wjp719
added a commit
to wjp719/elasticsearch
that referenced
this pull request
Sep 4, 2021
* master: (128 commits) Mute DieWithDignityIT (elastic#77283) Fix randomization in MlNodeShutdownIT (elastic#77281) Add target_node_name for REPLACE shutdown type (elastic#77151) [DOCS] Adds information about version compatibility headers (elastic#77096) Fix template equals when mappings are wrapped (elastic#77008) Fix TextFieldMapper Retaining a Reference to its Builder (elastic#77251) Move die with dignity to be a test module (elastic#77136) Update task names for rest compatiblity (elastic#75267) [ML] adjusting bwc serialization for elastic#77256 (elastic#77257) Move `index.hidden` from Static to Dynamic settings (elastic#77218) Handle cgroups v2 in `OsProbe` (elastic#77128) Choose postings format from FieldMapper instead of MappedFieldType (elastic#77234) Add segment sorter for data streams (elastic#75195) Update skip after backport (elastic#77212) [ML] adding new defer_definition_decompression parameter to put trained model API (elastic#77189) [ML] Fix bug in inference stats persister for when feature reset is called Only check replicas in cancelling existing recoveries. (elastic#60564) Format `AbstractFilteringTestCase` (elastic#77217) [DOCS] Fixes line breaks. (elastic#77248) Convert 'routing' values in REST API tests to strings ... # Conflicts: # server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java
elasticsearchmachine
pushed a commit
that referenced
this pull request
Sep 7, 2021
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 <elasticmachine@users.noreply.github.com>
# Conflicts:
# server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateServiceTests.java
Co-authored-by: weizijun <weizijun1989@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
repreduced:
MetadataIndexTemplateServiceTests.testAddComponentTemplate
when mappings are not null, the case will failed.