Skip to content

Commit 7a597ca

Browse files
authored
Reenable BWC tests after backport of #37899 (#38093)
This commit adapts the version used in StartedShardEntry serialization after the backport of #37899 and reenables bwc tests. Related to #37899 Related to #38074
1 parent b7de8e1 commit 7a597ca

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ task verifyVersions {
159159
* the enabled state of every bwc task. It should be set back to true
160160
* after the backport of the backcompat code is complete.
161161
*/
162-
final boolean bwc_tests_enabled = false
163-
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/37899" /* place a PR link here when committing bwc changes */
162+
final boolean bwc_tests_enabled = true
163+
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
164164
if (bwc_tests_enabled == false) {
165165
if (bwc_tests_disabled_issue.isEmpty()) {
166166
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")

server/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ public static class StartedShardEntry extends TransportRequest {
606606
if (in.getVersion().before(Version.V_6_3_0)) {
607607
primaryTerm = in.readVLong();
608608
assert primaryTerm == UNASSIGNED_PRIMARY_TERM : "shard is only started by itself: primary term [" + primaryTerm + "]";
609-
} else if (in.getVersion().onOrAfter(Version.V_7_0_0)) { // TODO update version to 6.7.0 after backport
609+
} else if (in.getVersion().onOrAfter(Version.V_6_7_0)) {
610610
primaryTerm = in.readVLong();
611611
} else {
612612
primaryTerm = UNASSIGNED_PRIMARY_TERM;
@@ -632,7 +632,7 @@ public void writeTo(StreamOutput out) throws IOException {
632632
out.writeString(allocationId);
633633
if (out.getVersion().before(Version.V_6_3_0)) {
634634
out.writeVLong(0L);
635-
} else if (out.getVersion().onOrAfter(Version.V_7_0_0)) { // TODO update version to 6.7.0 after backport
635+
} else if (out.getVersion().onOrAfter(Version.V_6_7_0)) {
636636
out.writeVLong(primaryTerm);
637637
}
638638
out.writeString(message);

server/src/test/java/org/elasticsearch/cluster/action/shard/ShardStateActionTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ public void testStartedShardEntrySerialization() throws Exception {
544544
final StartedShardEntry deserialized = new StartedShardEntry(in);
545545
assertThat(deserialized.shardId, equalTo(shardId));
546546
assertThat(deserialized.allocationId, equalTo(allocationId));
547-
if (version.onOrAfter(Version.V_7_0_0)) { // TODO update version to 6.7.0 after backport
547+
if (version.onOrAfter(Version.V_6_7_0)) {
548548
assertThat(deserialized.primaryTerm, equalTo(primaryTerm));
549549
} else {
550550
assertThat(deserialized.primaryTerm, equalTo(0L));

0 commit comments

Comments
 (0)