diff --git a/build.gradle b/build.gradle index 42d6f0e9e9c9a..ccd793e93e94f 100644 --- a/build.gradle +++ b/build.gradle @@ -183,8 +183,8 @@ task verifyVersions { * after the backport of the backcompat code is complete. */ -boolean bwc_tests_enabled = false -final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/55911" /* place a PR link here when committing bwc changes */ +boolean bwc_tests_enabled = true +final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */ if (bwc_tests_enabled == false) { if (bwc_tests_disabled_issue.isEmpty()) { throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false") diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.voting_config_exclusions/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.voting_config_exclusions/10_basic.yml index b0aa1529de989..327344c8daf55 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.voting_config_exclusions/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.voting_config_exclusions/10_basic.yml @@ -72,13 +72,13 @@ teardown: --- "Throw exception when adding voting config exclusion without specifying nodes": - do: - catch: /You must set \[node_names\] or \[node_ids\] but not both/ + catch: /(You must set \[node_names\] or \[node_ids\] but not both|Please set node identifiers correctly. One and only one of \[node_name\], \[node_names\] and \[node_ids\] has to be set)/ cluster.post_voting_config_exclusions: {} --- "Throw exception when adding voting config exclusion and specifying both node_ids and node_names": - do: - catch: /You must set \[node_names\] or \[node_ids\] but not both/ + catch: /(You must set \[node_names\] or \[node_ids\] but not both|Please set node identifiers correctly. One and only one of \[node_name\], \[node_names\] and \[node_ids\] has to be set)/ cluster.post_voting_config_exclusions: node_ids: nodeId node_names: nodeName diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Job.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Job.java index 5330643b0f3da..a96c1c63f53c4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Job.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Job.java @@ -207,12 +207,6 @@ public Job(StreamInput in) throws IOException { description = in.readOptionalString(); createTime = new Date(in.readVLong()); finishedTime = in.readBoolean() ? new Date(in.readVLong()) : null; - // for removed last_data_time field - if (in.getVersion().before(Version.V_7_0_0)) { - if (in.readBoolean()) { - in.readVLong(); - } - } analysisConfig = new AnalysisConfig(in); analysisLimits = in.readOptionalWriteable(AnalysisLimits::new); dataDescription = in.readOptionalWriteable(DataDescription::new); @@ -220,28 +214,19 @@ public Job(StreamInput in) throws IOException { renormalizationWindowDays = in.readOptionalLong(); backgroundPersistInterval = in.readOptionalTimeValue(); modelSnapshotRetentionDays = in.readOptionalLong(); - // TODO: change version in backport - if (in.getVersion().onOrAfter(Version.V_8_0_0)) { - dailyModelSnapshotRetentionAfterDays = in.readOptionalLong(); - } else { - dailyModelSnapshotRetentionAfterDays = null; - } + dailyModelSnapshotRetentionAfterDays = in.readOptionalLong(); resultsRetentionDays = in.readOptionalLong(); Map readCustomSettings = in.readMap(); customSettings = readCustomSettings == null ? null : Collections.unmodifiableMap(readCustomSettings); modelSnapshotId = in.readOptionalString(); - if (in.getVersion().onOrAfter(Version.V_7_0_0) && in.readBoolean()) { + if (in.readBoolean()) { modelSnapshotMinVersion = Version.readVersion(in); } else { modelSnapshotMinVersion = null; } resultsIndexName = in.readString(); deleting = in.readBoolean(); - if (in.getVersion().onOrAfter(Version.V_7_5_0)) { - allowLazyOpen = in.readBoolean(); - } else { - allowLazyOpen = false; - } + allowLazyOpen = in.readBoolean(); } /** @@ -486,10 +471,6 @@ public void writeTo(StreamOutput out) throws IOException { } else { out.writeBoolean(false); } - // for removed last_data_time field - if (out.getVersion().before(Version.V_7_0_0)) { - out.writeBoolean(false); - } analysisConfig.writeTo(out); out.writeOptionalWriteable(analysisLimits); out.writeOptionalWriteable(dataDescription); @@ -497,26 +478,19 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalLong(renormalizationWindowDays); out.writeOptionalTimeValue(backgroundPersistInterval); out.writeOptionalLong(modelSnapshotRetentionDays); - // TODO: change version in backport - if (out.getVersion().onOrAfter(Version.V_8_0_0)) { - out.writeOptionalLong(dailyModelSnapshotRetentionAfterDays); - } + out.writeOptionalLong(dailyModelSnapshotRetentionAfterDays); out.writeOptionalLong(resultsRetentionDays); out.writeMap(customSettings); out.writeOptionalString(modelSnapshotId); - if (out.getVersion().onOrAfter(Version.V_7_0_0)) { - if (modelSnapshotMinVersion != null) { - out.writeBoolean(true); - Version.writeVersion(modelSnapshotMinVersion, out); - } else { - out.writeBoolean(false); - } + if (modelSnapshotMinVersion != null) { + out.writeBoolean(true); + Version.writeVersion(modelSnapshotMinVersion, out); + } else { + out.writeBoolean(false); } out.writeString(resultsIndexName); out.writeBoolean(deleting); - if (out.getVersion().onOrAfter(Version.V_7_5_0)) { - out.writeBoolean(allowLazyOpen); - } + out.writeBoolean(allowLazyOpen); } @Override @@ -732,23 +706,18 @@ public Builder(StreamInput in) throws IOException { renormalizationWindowDays = in.readOptionalLong(); backgroundPersistInterval = in.readOptionalTimeValue(); modelSnapshotRetentionDays = in.readOptionalLong(); - // TODO: change version in backport - if (in.getVersion().onOrAfter(Version.V_8_0_0)) { - dailyModelSnapshotRetentionAfterDays = in.readOptionalLong(); - } + dailyModelSnapshotRetentionAfterDays = in.readOptionalLong(); resultsRetentionDays = in.readOptionalLong(); customSettings = in.readMap(); modelSnapshotId = in.readOptionalString(); - if (in.getVersion().onOrAfter(Version.V_7_0_0) && in.readBoolean()) { + if (in.readBoolean()) { modelSnapshotMinVersion = Version.readVersion(in); } else { modelSnapshotMinVersion = null; } resultsIndexName = in.readOptionalString(); deleting = in.readBoolean(); - if (in.getVersion().onOrAfter(Version.V_7_5_0)) { - allowLazyOpen = in.readBoolean(); - } + allowLazyOpen = in.readBoolean(); } public Builder setId(String id) { @@ -934,26 +903,19 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalLong(renormalizationWindowDays); out.writeOptionalTimeValue(backgroundPersistInterval); out.writeOptionalLong(modelSnapshotRetentionDays); - // TODO: change version in backport - if (out.getVersion().onOrAfter(Version.V_8_0_0)) { - out.writeOptionalLong(dailyModelSnapshotRetentionAfterDays); - } + out.writeOptionalLong(dailyModelSnapshotRetentionAfterDays); out.writeOptionalLong(resultsRetentionDays); out.writeMap(customSettings); out.writeOptionalString(modelSnapshotId); - if (out.getVersion().onOrAfter(Version.V_7_0_0)) { - if (modelSnapshotMinVersion != null) { - out.writeBoolean(true); - Version.writeVersion(modelSnapshotMinVersion, out); - } else { - out.writeBoolean(false); - } + if (modelSnapshotMinVersion != null) { + out.writeBoolean(true); + Version.writeVersion(modelSnapshotMinVersion, out); + } else { + out.writeBoolean(false); } out.writeOptionalString(resultsIndexName); out.writeBoolean(deleting); - if (out.getVersion().onOrAfter(Version.V_7_5_0)) { - out.writeBoolean(allowLazyOpen); - } + out.writeBoolean(allowLazyOpen); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/JobUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/JobUpdate.java index f68c58f312519..0d30f607a7fc9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/JobUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/JobUpdate.java @@ -127,12 +127,7 @@ public JobUpdate(StreamInput in) throws IOException { renormalizationWindowDays = in.readOptionalLong(); backgroundPersistInterval = in.readOptionalTimeValue(); modelSnapshotRetentionDays = in.readOptionalLong(); - // TODO: change version on backport - if (in.getVersion().onOrAfter(Version.V_8_0_0)) { - dailyModelSnapshotRetentionAfterDays = in.readOptionalLong(); - } else { - dailyModelSnapshotRetentionAfterDays = null; - } + dailyModelSnapshotRetentionAfterDays = in.readOptionalLong(); resultsRetentionDays = in.readOptionalLong(); if (in.readBoolean()) { categorizationFilters = in.readStringList(); @@ -147,16 +142,12 @@ public JobUpdate(StreamInput in) throws IOException { jobVersion = null; } clearJobFinishTime = in.readOptionalBoolean(); - if (in.getVersion().onOrAfter(Version.V_7_0_0) && in.readBoolean()) { + if (in.readBoolean()) { modelSnapshotMinVersion = Version.readVersion(in); } else { modelSnapshotMinVersion = null; } - if (in.getVersion().onOrAfter(Version.V_7_5_0)) { - allowLazyOpen = in.readOptionalBoolean(); - } else { - allowLazyOpen = null; - } + allowLazyOpen = in.readOptionalBoolean(); } @Override @@ -174,10 +165,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalLong(renormalizationWindowDays); out.writeOptionalTimeValue(backgroundPersistInterval); out.writeOptionalLong(modelSnapshotRetentionDays); - // TODO: change on backport - if (out.getVersion().onOrAfter(Version.V_8_0_0)) { - out.writeOptionalLong(dailyModelSnapshotRetentionAfterDays); - } + out.writeOptionalLong(dailyModelSnapshotRetentionAfterDays); out.writeOptionalLong(resultsRetentionDays); out.writeBoolean(categorizationFilters != null); if (categorizationFilters != null) { @@ -192,17 +180,13 @@ public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(false); } out.writeOptionalBoolean(clearJobFinishTime); - if (out.getVersion().onOrAfter(Version.V_7_0_0)) { - if (modelSnapshotMinVersion != null) { - out.writeBoolean(true); - Version.writeVersion(modelSnapshotMinVersion, out); - } else { - out.writeBoolean(false); - } - } - if (out.getVersion().onOrAfter(Version.V_7_5_0)) { - out.writeOptionalBoolean(allowLazyOpen); + if (modelSnapshotMinVersion != null) { + out.writeBoolean(true); + Version.writeVersion(modelSnapshotMinVersion, out); + } else { + out.writeBoolean(false); } + out.writeOptionalBoolean(allowLazyOpen); } public String getJobId() {