-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Disallow duplicate template names in dynamic_template
#53326
Comments
Pinging @elastic/es-search (:Search/Mapping) |
It's great we're moving this forward, there have been some long-standing issues in this area! Tagging @elastic/beats and @elastic/apm-server so they're aware of the above proposal to disallow having two |
APM Server currently makes use of multiple dynamic templates with the same key. Linking elastic/beats#17203 (comment) here. |
This has created various bugs/problems observed in the field. 1. ObservationsWe have observed inconsistent behaviours in both versions 7.17.5 and 8.3.1 when regular indices or data streams are used. 1.1 Regular index with legacy index template
Results:
1.2 Regular index with composable index template
Results:
1.3 Data stream with composable index template
Results:
2. Moving forward
|
Pinging @elastic/es-search-foundations (Team:Search Foundations) |
Today, dynamic templates can contain multiple template names with the same name. This can be the result of either adding the same template multiple times in error (like the case described in #28988 or explicitly to group small variations of the same template like mentioned in this example of an APM index templates (elastic/apm-server#2693).
This creates problems and bugs when these duplicate templates are merged e.g. during inheritance like described in elastic/apm-server#2693 (comment).
Instead, all names should be a unique ID, and we should fail when there are duplicates.
To make this change in a backwards compatible way, we should start logging warnings about this problem starting in one of the next 7.x releases.
In order to make sure that existing dynamic templates (e.g. inside index templates) still work when upgrading to 8, and we are late in the 7.x series, we need to support creating indices from “broken” existing templates (like ones uploaded in 7.1) until 8.latest.
At the same time, from now on we can start warning users when they create index templates or indix mapping containing duplicates in the
dynamic_templates
section. In 8.x we should start rejecting new index templates and index mappings with duplicate names, (potentially accept but forcefully rewrite them to unique IDs if request is made with version 7 compatibility requested - to be discussed)In 9 we should aim at rejecting broken templates and new indices created from them entirely.
Open questions:
The text was updated successfully, but these errors were encountered: