Skip to content

Commit 8a2cfb5

Browse files
sachinpkaleSachin Kale
authored andcommitted
Change version to 2.17.0 for shallow snapshot V2 restore changes (opensearch-project#15723)
Signed-off-by: Sachin Kale <[email protected]> Co-authored-by: Sachin Kale <[email protected]>
1 parent 3f627a3 commit 8a2cfb5

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public RestoreSnapshotRequest(StreamInput in) throws IOException {
161161
if (in.getVersion().onOrAfter(Version.V_2_10_0)) {
162162
sourceRemoteStoreRepository = in.readOptionalString();
163163
}
164-
if (in.getVersion().onOrAfter(Version.CURRENT)) {
164+
if (in.getVersion().onOrAfter(Version.V_2_17_0)) {
165165
sourceRemoteTranslogRepository = in.readOptionalString();
166166
}
167167
}
@@ -188,7 +188,7 @@ public void writeTo(StreamOutput out) throws IOException {
188188
if (out.getVersion().onOrAfter(Version.V_2_10_0)) {
189189
out.writeOptionalString(sourceRemoteStoreRepository);
190190
}
191-
if (out.getVersion().onOrAfter(Version.CURRENT)) {
191+
if (out.getVersion().onOrAfter(Version.V_2_17_0)) {
192192
out.writeOptionalString(sourceRemoteTranslogRepository);
193193
}
194194
}

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@
4848
import java.io.IOException;
4949
import java.util.Objects;
5050

51-
import static org.opensearch.Version.CURRENT;
52-
5351
/**
5452
* Represents the recovery source of a shard. Available recovery types are:
5553
* <p>
@@ -335,7 +333,7 @@ public SnapshotRecoverySource(
335333
remoteStoreIndexShallowCopy = false;
336334
sourceRemoteStoreRepository = null;
337335
}
338-
if (in.getVersion().onOrAfter(CURRENT)) {
336+
if (in.getVersion().onOrAfter(Version.V_2_17_0)) {
339337
sourceRemoteTranslogRepository = in.readOptionalString();
340338
pinnedTimestamp = in.readLong();
341339
} else {
@@ -399,7 +397,7 @@ protected void writeAdditionalFields(StreamOutput out) throws IOException {
399397
out.writeBoolean(remoteStoreIndexShallowCopy);
400398
out.writeOptionalString(sourceRemoteStoreRepository);
401399
}
402-
if (out.getVersion().onOrAfter(CURRENT)) {
400+
if (out.getVersion().onOrAfter(Version.V_2_17_0)) {
403401
out.writeOptionalString(sourceRemoteTranslogRepository);
404402
out.writeLong(pinnedTimestamp);
405403
}

0 commit comments

Comments
 (0)