Skip to content

Commit

Permalink
Properly handle wildcards in data stream deletion requests (#78463) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
danhermann committed Sep 30, 2021
1 parent be6713b commit 43077c1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ protected void masterOperation(
for (String name : names) {
systemIndices.validateDataStreamAccess(name, threadPool.getThreadContext());
}
request.indices(names.toArray(Strings.EMPTY_ARRAY));

clusterService.submitStateUpdateTask(
"remove-data-stream [" + Strings.arrayToCommaDelimitedString(request.getNames()) + "]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,43 @@ setup:
indices.delete_data_stream:
name: simple-data-stream2

---
"Delete data stream by wildcard":
- skip:
version: " - 7.99.99"
reason: "change to [-7.8.99] and [data streams only supported in 7.9+] after backport"

- do:
indices.create_data_stream:
name: simple-data-stream1
- is_true: acknowledged

- do:
indices.create_data_stream:
name: simple-data-stream2
- is_true: acknowledged

- do:
indices.delete_data_stream:
name: no-matching-data-streams*
- is_true: acknowledged

- do:
indices.get_data_stream:
name: "*"
- match: { data_streams.0.name: simple-data-stream1 }
- match: { data_streams.1.name: simple-data-stream2 }

- do:
indices.delete_data_stream:
name: simple-data-stream*
- is_true: acknowledged

- do:
indices.get_data_stream:
name: "*"
- length: { data_streams: 0 }

---
"append-only writes to backing indices prohibited":
- skip:
Expand Down

0 comments on commit 43077c1

Please sign in to comment.