diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/Classification.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/Classification.java index cd96b815fc11e..ed4cb1fe18f8e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/Classification.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/Classification.java @@ -119,7 +119,7 @@ public Classification(StreamInput in) throws IOException { predictionFieldName = in.readOptionalString(); numTopClasses = in.readOptionalVInt(); trainingPercent = in.readDouble(); - if (in.getVersion().onOrAfter(Version.CURRENT)) { + if (in.getVersion().onOrAfter(Version.V_7_6_0)) { randomizeSeed = in.readOptionalLong(); } else { randomizeSeed = Randomness.get().nextLong(); @@ -163,7 +163,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalString(predictionFieldName); out.writeOptionalVInt(numTopClasses); out.writeDouble(trainingPercent); - if (out.getVersion().onOrAfter(Version.CURRENT)) { + if (out.getVersion().onOrAfter(Version.V_7_6_0)) { out.writeOptionalLong(randomizeSeed); } } @@ -180,7 +180,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.field(PREDICTION_FIELD_NAME.getPreferredName(), predictionFieldName); } builder.field(TRAINING_PERCENT.getPreferredName(), trainingPercent); - if (version.onOrAfter(Version.CURRENT)) { + if (version.onOrAfter(Version.V_7_6_0)) { builder.field(RANDOMIZE_SEED.getPreferredName(), randomizeSeed); } builder.endObject(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/Regression.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/Regression.java index dd8f6a91272c2..8fffcd0f573da 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/Regression.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/Regression.java @@ -91,7 +91,7 @@ public Regression(StreamInput in) throws IOException { boostedTreeParams = new BoostedTreeParams(in); predictionFieldName = in.readOptionalString(); trainingPercent = in.readDouble(); - if (in.getVersion().onOrAfter(Version.CURRENT)) { + if (in.getVersion().onOrAfter(Version.V_7_6_0)) { randomizeSeed = in.readOptionalLong(); } else { randomizeSeed = Randomness.get().nextLong(); @@ -130,7 +130,7 @@ public void writeTo(StreamOutput out) throws IOException { boostedTreeParams.writeTo(out); out.writeOptionalString(predictionFieldName); out.writeDouble(trainingPercent); - if (out.getVersion().onOrAfter(Version.CURRENT)) { + if (out.getVersion().onOrAfter(Version.V_7_6_0)) { out.writeOptionalLong(randomizeSeed); } } @@ -146,7 +146,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.field(PREDICTION_FIELD_NAME.getPreferredName(), predictionFieldName); } builder.field(TRAINING_PERCENT.getPreferredName(), trainingPercent); - if (version.onOrAfter(Version.CURRENT)) { + if (version.onOrAfter(Version.V_7_6_0)) { builder.field(RANDOMIZE_SEED.getPreferredName(), randomizeSeed); } builder.endObject(); diff --git a/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/90_ml_data_frame_analytics_crud.yml b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/90_ml_data_frame_analytics_crud.yml index 8082147160718..7780691b2bbbd 100644 --- a/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/90_ml_data_frame_analytics_crud.yml +++ b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/90_ml_data_frame_analytics_crud.yml @@ -1,8 +1,3 @@ -setup: - - skip: - version: "all" - reason: "Until backport of https://github.com/elastic/elasticsearch/issues/49690" - --- "Get old outlier_detection job": @@ -65,6 +60,7 @@ setup: - match: { data_frame_analytics.0.dest.index: "old_cluster_regression_job_results" } - match: { data_frame_analytics.0.analysis.regression.dependent_variable: "foo" } - match: { data_frame_analytics.0.analysis.regression.training_percent: 100.0 } + - is_true: data_frame_analytics.0.analysis.regression.randomize_seed --- "Get old regression job stats": diff --git a/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/90_ml_data_frame_analytics_crud.yml b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/90_ml_data_frame_analytics_crud.yml index ba2cf40411672..fe160bba15f23 100644 --- a/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/90_ml_data_frame_analytics_crud.yml +++ b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/90_ml_data_frame_analytics_crud.yml @@ -1,7 +1,4 @@ setup: - - skip: - version: "all" - reason: "Until backport of https://github.com/elastic/elasticsearch/issues/49690" - do: index: diff --git a/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/90_ml_data_frame_analytics_crud.yml b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/90_ml_data_frame_analytics_crud.yml index 462a1fd76c011..14438883f0da1 100644 --- a/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/90_ml_data_frame_analytics_crud.yml +++ b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/90_ml_data_frame_analytics_crud.yml @@ -1,8 +1,3 @@ -setup: - - skip: - version: "all" - reason: "Until backport of https://github.com/elastic/elasticsearch/issues/49690" - --- "Get old cluster outlier_detection job": @@ -45,6 +40,7 @@ setup: - match: { data_frame_analytics.0.dest.index: "old_cluster_regression_job_results" } - match: { data_frame_analytics.0.analysis.regression.dependent_variable: "foo" } - match: { data_frame_analytics.0.analysis.regression.training_percent: 100.0 } + - is_true: data_frame_analytics.0.analysis.regression.randomize_seed --- "Get old cluster regression job stats":