From 7079a3b09f415316479261639643949ef2ac968a Mon Sep 17 00:00:00 2001 From: Dan Hermann Date: Tue, 16 Jun 2020 09:37:32 -0500 Subject: [PATCH] [7.x] Prohibit freezing the write index of a data stream (#58168) --- .../test/indices.freeze/10_basic.yml | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/test/indices.freeze/10_basic.yml b/x-pack/plugin/src/test/resources/rest-api-spec/test/indices.freeze/10_basic.yml index 16a0aace0e4..c6f6ca576d1 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/test/indices.freeze/10_basic.yml +++ b/x-pack/plugin/src/test/resources/rest-api-spec/test/indices.freeze/10_basic.yml @@ -132,3 +132,41 @@ foo: hello - match: {hits.total: 1} + +--- +"Cannot freeze write index for data stream": + - skip: + version: " - 7.99.99" + reason: "change to 7.8.99 after backporting" + features: allowed_warnings + + - do: + allowed_warnings: + - "index template [my-template1] has index patterns [simple-data-stream1] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-template1] will take precedence during new index creation" + indices.put_index_template: + name: my-template1 + body: + index_patterns: [simple-data-stream1] + template: + mappings: + properties: + '@timestamp': + type: date + data_stream: + timestamp_field: '@timestamp' + + - do: + indices.create_data_stream: + name: simple-data-stream1 + - is_true: acknowledged + + - do: + catch: bad_request + indices.freeze: + index: ".ds-simple-data-stream1-000001" + + - do: + indices.delete_data_stream: + name: simple-data-stream1 + - is_true: acknowledged +