You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support specifying multiple templates names in delete component template api (#70379)
Backporting #70314 to 7.x branch.
Add support to delete component templates api to specify multiple template
names separated by a comma.
Change the cleanup template logic for rest tests to remove all component templates via a single delete component template request. This to optimize the cleanup logic. After each rest test we delete all templates. So deleting templates this via a single api call (and thus single cluster state update) saves a lot of time considering the number of rest tests.
Older versions don't support component / composable index templates
and/or data streams. Yet the test base class tries to remove objects
after each test, which adds a significant number of lines to the
log files (which slows the tests down). The ESRestTestCase will
now check whether all nodes have a specific version and then decide
whether data streams and component / composable index templates will
be deleted.
Also ensured that the logstash-index-template and security-index-template
aren't deleted between tests, these templates are builtin templates that
ES will install if missing. So if tests remove these templates between tests
then ES will add these template back almost immediately. These causes
many log lines and a lot of cluster state updates, which slow tests down.
Relates to #69973
Co-authored-by: Lee Hinman <[email protected]>
Co-authored-by: Lee Hinman <[email protected]>
Copy file name to clipboardExpand all lines: rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_index_template/10_basic.yml
+78
Original file line number
Diff line number
Diff line change
@@ -119,3 +119,81 @@
119
119
indices.put_index_template:
120
120
name: test
121
121
body: {}
122
+
123
+
---
124
+
"Delete multiple templates":
125
+
- skip:
126
+
version: " - 7.99.99"
127
+
reason: "not yet backported"
128
+
features: allowed_warnings
129
+
130
+
- do:
131
+
allowed_warnings:
132
+
- "index template [foo] has index patterns [foo-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [foo] will take precedence during new index creation"
133
+
indices.put_index_template:
134
+
name: foo
135
+
body:
136
+
index_patterns: foo-*
137
+
template:
138
+
settings:
139
+
number_of_shards: 1
140
+
number_of_replicas: 0
141
+
142
+
- do:
143
+
allowed_warnings:
144
+
- "index template [bar] has index patterns [bar-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [bar] will take precedence during new index creation"
145
+
indices.put_index_template:
146
+
name: bar
147
+
body:
148
+
index_patterns: bar-*
149
+
template:
150
+
settings:
151
+
number_of_shards: 1
152
+
number_of_replicas: 0
153
+
154
+
- do:
155
+
allowed_warnings:
156
+
- "index template [baz] has index patterns [baz-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [baz] will take precedence during new index creation"
Copy file name to clipboardExpand all lines: server/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteComponentTemplateAction.java
Copy file name to clipboardExpand all lines: server/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateAction.java
+2-2
Original file line number
Diff line number
Diff line change
@@ -56,13 +56,13 @@ public Request(String... names) {
Copy file name to clipboardExpand all lines: server/src/main/java/org/elasticsearch/action/admin/indices/template/delete/TransportDeleteComponentTemplateAction.java
0 commit comments