Skip to content

Commit c522341

Browse files
original-brownbeardavidkyle
authored andcommitted
SNAPSHOTS: Adjust BwC Versions in Restore Logic (#36718)
* Re-enables bwc tests with adjusted version conditions now that #36397 enables concurrent snapshots in 6.6+
1 parent 46f86b7 commit c522341

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

build.gradle

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

server/src/main/java/org/elasticsearch/cluster/RestoreInProgress.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
public class RestoreInProgress extends AbstractNamedDiffable<Custom> implements Custom, Iterable<RestoreInProgress.Entry> {
4747

4848
/**
49-
* Fallback UUID used for restore operations that were started before v7.0 and don't have a uuid in the cluster state.
49+
* Fallback UUID used for restore operations that were started before v6.6 and don't have a uuid in the cluster state.
5050
*/
5151
public static final String BWC_UUID = new UUID(0, 0).toString();
5252

@@ -436,7 +436,7 @@ public RestoreInProgress(StreamInput in) throws IOException {
436436
final ImmutableOpenMap.Builder<String, Entry> entriesBuilder = ImmutableOpenMap.builder(count);
437437
for (int i = 0; i < count; i++) {
438438
final String uuid;
439-
if (in.getVersion().onOrAfter(Version.V_7_0_0)) {
439+
if (in.getVersion().onOrAfter(Version.V_6_6_0)) {
440440
uuid = in.readString();
441441
} else {
442442
uuid = BWC_UUID;
@@ -468,7 +468,7 @@ public void writeTo(StreamOutput out) throws IOException {
468468
out.writeVInt(entries.size());
469469
for (ObjectCursor<Entry> v : entries.values()) {
470470
Entry entry = v.value;
471-
if (out.getVersion().onOrAfter(Version.V_7_0_0)) {
471+
if (out.getVersion().onOrAfter(Version.V_6_6_0)) {
472472
out.writeString(entry.uuid);
473473
}
474474
entry.snapshot().writeTo(out);

server/src/main/java/org/elasticsearch/cluster/routing/RecoverySource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public SnapshotRecoverySource(String restoreUUID, Snapshot snapshot, Version ver
222222
}
223223

224224
SnapshotRecoverySource(StreamInput in) throws IOException {
225-
if (in.getVersion().onOrAfter(Version.V_7_0_0)) {
225+
if (in.getVersion().onOrAfter(Version.V_6_6_0)) {
226226
restoreUUID = in.readString();
227227
} else {
228228
restoreUUID = RestoreInProgress.BWC_UUID;
@@ -250,7 +250,7 @@ public Version version() {
250250

251251
@Override
252252
protected void writeAdditionalFields(StreamOutput out) throws IOException {
253-
if (out.getVersion().onOrAfter(Version.V_7_0_0)) {
253+
if (out.getVersion().onOrAfter(Version.V_6_6_0)) {
254254
out.writeString(restoreUUID);
255255
}
256256
snapshot.writeTo(out);

0 commit comments

Comments
 (0)