Explorar el Código

[ML] adjusting BWC for datafeed stats for #73926 (#74003)

Benjamin Trent hace 4 años
padre
commit
6235ff2a5b

+ 2 - 9
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsStatsAction.java

@@ -6,7 +6,6 @@
  */
 package org.elasticsearch.xpack.core.ml.action;
 
-import org.elasticsearch.Version;
 import org.elasticsearch.action.ActionRequestValidationException;
 import org.elasticsearch.action.ActionType;
 import org.elasticsearch.action.support.master.MasterNodeReadRequest;
@@ -151,11 +150,7 @@ public class GetDatafeedsStatsAction extends ActionType<GetDatafeedsStatsAction.
                 node = in.readOptionalWriteable(DiscoveryNode::new);
                 assignmentExplanation = in.readOptionalString();
                 timingStats = in.readOptionalWriteable(DatafeedTimingStats::new);
-                if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
-                    runningState = in.readOptionalWriteable(RunningState::new);
-                } else {
-                    runningState = null;
-                }
+                runningState = in.readOptionalWriteable(RunningState::new);
             }
 
             public String getDatafeedId() {
@@ -222,9 +217,7 @@ public class GetDatafeedsStatsAction extends ActionType<GetDatafeedsStatsAction.
                 out.writeOptionalWriteable(node);
                 out.writeOptionalString(assignmentExplanation);
                 out.writeOptionalWriteable(timingStats);
-                if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
-                    out.writeOptionalWriteable(runningState);
-                }
+                out.writeOptionalWriteable(runningState);
             }
 
             @Override

+ 9 - 0
x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/40_ml_datafeed_crud.yml

@@ -1,5 +1,8 @@
 ---
 "Test old cluster datafeed without aggs":
+  - skip:
+      version: "all"
+      reason:  "backport: https://github.com/elastic/elasticsearch/pull/73926"
   - do:
       ml.get_datafeeds:
         datafeed_id: old-cluster-datafeed-without-aggs
@@ -42,6 +45,9 @@
 
 ---
 "Put job and datafeed without aggs in mixed cluster":
+  - skip:
+      version: "all"
+      reason:  "backport: https://github.com/elastic/elasticsearch/pull/73926"
   - do:
       ml.put_job:
         job_id: mixed-cluster-datafeed-job-without-aggs
@@ -86,6 +92,9 @@
 
 ---
 "Put job and datafeed with aggs in mixed cluster":
+  - skip:
+      version: "all"
+      reason:  "backport: https://github.com/elastic/elasticsearch/pull/73926"
   - do:
       ml.put_job:
         job_id: mixed-cluster-datafeed-job-with-aggs

+ 7 - 1
x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/40_ml_datafeed_crud.yml

@@ -5,9 +5,12 @@ setup:
         wait_for_nodes: 3
         # wait for long enough that we give delayed unassigned shards to stop being delayed
         timeout: 70s
- 
+
 ---
 "Test old and mixed cluster datafeeds without aggs":
+  - skip:
+      version: "all"
+      reason:  "backport: https://github.com/elastic/elasticsearch/pull/73926"
   - do:
       indices.create:
         index: airline-data
@@ -105,6 +108,9 @@ setup:
 
 ---
 "Test old and mixed cluster datafeeds with aggs":
+  - skip:
+      version: "all"
+      reason:  "backport: https://github.com/elastic/elasticsearch/pull/73926"
   - do:
       indices.create:
         index: airline-data