Browse Source

Adjust version of hidden data streams (#64468)

This change adjust version used in data stream serialization for BwC.
It also fixes flaky yaml test by moving hidden template to the test itself instead of the setup
Przemko Robakowski 5 years ago
parent
commit
388a86ab6f

+ 1 - 1
server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java

@@ -43,7 +43,7 @@ import java.util.Objects;
 public final class DataStream extends AbstractDiffable<DataStream> implements ToXContentObject {
 
     public static final String BACKING_INDEX_PREFIX = ".ds-";
-    public static final Version HIDDEN_VERSION = Version.V_8_0_0;
+    public static final Version HIDDEN_VERSION = Version.V_7_11_0;
 
     private final String name;
     private final TimestampField timeStampField;

+ 14 - 12
x-pack/plugin/src/test/resources/rest-api-spec/test/data_stream/10_basic.yml

@@ -27,16 +27,6 @@ setup:
                   type: date_nanos
           data_stream: {}
 
-  - do:
-      allowed_warnings:
-        - "index template [my-template3] has index patterns [.hidden-data-stream,hidden-data-stream] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-template3] will take precedence during new index creation"
-      indices.put_index_template:
-        name: my-template3
-        body:
-          index_patterns: [.hidden-data-stream,hidden-data-stream]
-          data_stream:
-            hidden: true
-
 ---
 "Create data stream":
   - skip:
@@ -116,8 +106,17 @@ setup:
 ---
 "Create hidden data stream":
   - skip:
-      version: " - 7.99.99"
-      reason: "re-enable in 7.11 when backported"
+      version: " - 7.10.99"
+      reason: "hidden data streams only available in 7.11"
+  - do:
+      allowed_warnings:
+        - "index template [my-template3] has index patterns [.hidden-data-stream,hidden-data-stream] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-template3] will take precedence during new index creation"
+      indices.put_index_template:
+        name: my-template3
+        body:
+          index_patterns: [ .hidden-data-stream,hidden-data-stream ]
+          data_stream:
+            hidden: true
   - do:
       indices.create_data_stream:
         name: hidden-data-stream
@@ -196,6 +195,9 @@ setup:
         name: .hidden-data-stream
   - is_true: acknowledged
 
+  - do:
+      indices.delete_index_template:
+        name: my-template3
 ---
 "Create data stream with invalid name":
   - skip: