Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Transform] re-enable BWC after backport of #70139 #70218

Merged
merged 2 commits into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ tasks.register("verifyVersions") {
* after the backport of the backcompat code is complete.
*/

boolean bwc_tests_enabled = false
String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/70203" /* place a PR link here when committing bwc changes */
boolean bwc_tests_enabled = true
String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
/*
* FIPS 140-2 behavior was fixed in 7.11.0. Before that there is no way to run elasticsearch in a
* JVM that is properly configured to be in fips mode with BCFIPS. For now we need to disable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void writeTo(StreamOutput out) throws IOException {
if (out.getVersion().onOrAfter(Version.V_7_4_0)) {
out.writeString(id);
// 7.13 introduced the waiting state, in older version report the state as started
if (out.getVersion().before(Version.V_8_0_0) && state.equals(State.WAITING)) { // TODO: V_7_13_0
if (out.getVersion().before(Version.V_7_13_0) && state.equals(State.WAITING)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we simplify this in master? IIUC out.getVersion().before(Version.V_7_13_0) will always be false.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that's correct. The reason why I defer the removal of BWC versioning is ease of backporting. We have tons of that code on master and I am looking forward to remove it. I would like to do this in 1 iteration after we close active transform development on 7.x.

If you look at the outer if, I have to remove the branching, which will result in a mess after backporting. Useful as well: As development happens on master, we would remove the "documentation" about BWC handling and potentially forget to handle it correctly as part of the backport.

out.writeEnum(State.STARTED);
} else {
out.writeEnum(state);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void testBwcWith712() throws IOException {
output.setVersion(Version.V_7_12_0);
stats.writeTo(output);
try (StreamInput in = output.bytes().streamInput()) {
in.setVersion(Version.V_8_0_0); // TODO: V_7_13_0
in.setVersion(Version.V_7_13_0);
TransformStats statsFromOld = new TransformStats(in);
assertThat(statsFromOld.getState(), equalTo(STARTED));
}
Expand Down