Skip to content

[7.8] ITV2: disallow duplicate dynamic templates (#56291)#56614

Merged
andreidan merged 3 commits intoelastic:7.8from
andreidan:backport/78-itv2-dedup-dynamic-templates
May 14, 2020
Merged

[7.8] ITV2: disallow duplicate dynamic templates (#56291)#56614
andreidan merged 3 commits intoelastic:7.8from
andreidan:backport/78-itv2-dedup-dynamic-templates

Conversation

@andreidan
Copy link
Copy Markdown
Contributor

Dynamic templates can contain multiple templates with the same name. This
commit changes the way V2 index templates mappings are resolved to add
deduplication of dynamic templates when resolving the mappings, by having
the last dynamic templates override the ones defined with the same name
earlier in the dynamic_templates array.

This also filters duplicate dynamic templates when merging different component
templates that specify the same dynamic template and when merging the
mappings specified in the request with the ones in the index template.

(cherry picked from commit eb4a557)
Signed-off-by: Andrei Dan andrei.dan@elastic.co

Backport of #56291

Dynamic templates can contain multiple templates with the same name. This
commit changes the way V2 index templates mappings are resolved to add
deduplication of dynamic templates when resolving the mappings, by having
the last dynamic templates override the ones defined with the same name
earlier in the `dynamic_templates` array.

This also filters duplicate dynamic templates when merging different component
templates that specify the same dynamic template and when merging the
mappings specified in the request with the ones in the index template.

(cherry picked from commit eb4a557)
Signed-off-by: Andrei Dan <andrei.dan@elastic.co>
@andreidan andreidan added :Data Management/Indices APIs DO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead. backport v7.8.1 labels May 12, 2020
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Indices APIs)

@elasticmachine elasticmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label May 12, 2020
@andreidan
Copy link
Copy Markdown
Contributor Author

@elasticmachine update branch

@andreidan andreidan merged commit 3fb1e13 into elastic:7.8 May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport :Data Management/Indices APIs DO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead. Team:Data Management (obsolete) DO NOT USE. This team no longer exists. v7.8.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants