Skip to content

Commit

Permalink
Create Snapshot Changes for Shallow Copy Snapshot has been backported…
Browse files Browse the repository at this point in the history
… to 2.x, change version checks from 3.0 to 2.9. (#8092)

Signed-off-by: Harish Bhakuni <hbhakuni@amazon.com>
Co-authored-by: Harish Bhakuni <hbhakuni@amazon.com>
  • Loading branch information
harishbhakuni and Harish Bhakuni authored Jun 15, 2023
1 parent de51a49 commit 606255f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ private Entry(StreamInput in) throws IOException {
dataStreams = in.readStringList();
source = in.readOptionalWriteable(SnapshotId::new);
clones = in.readMap(RepositoryShardId::new, ShardSnapshotStatus::readFrom);
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_9_0)) {
remoteStoreIndexShallowCopy = in.readBoolean();
} else {
remoteStoreIndexShallowCopy = false;
Expand Down Expand Up @@ -736,7 +736,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeStringCollection(dataStreams);
out.writeOptionalWriteable(source);
out.writeMap(clones, (o, v) -> v.writeTo(o), (o, v) -> v.writeTo(o));
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_9_0)) {
out.writeBoolean(remoteStoreIndexShallowCopy);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ public SnapshotInfo(final StreamInput in) throws IOException {
includeGlobalState = in.readOptionalBoolean();
userMetadata = in.readMap();
dataStreams = in.readStringList();
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_9_0)) {
remoteStoreIndexShallowCopy = in.readOptionalBoolean();
}
}
Expand Down Expand Up @@ -866,7 +866,7 @@ public void writeTo(final StreamOutput out) throws IOException {
out.writeOptionalBoolean(includeGlobalState);
out.writeMap(userMetadata);
out.writeStringCollection(dataStreams);
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_9_0)) {
out.writeOptionalBoolean(remoteStoreIndexShallowCopy);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public void testSerDeRemoteStoreIndexShallowCopy() throws IOException {
}
}
try (StreamInput in = out.bytes().streamInput()) {
in.setVersion(Version.V_3_0_0);
in.setVersion(Version.V_2_9_0);
actualSnapshotsInProgress = new SnapshotsInProgress(in);
assert in.available() == 0;
for (Entry curr_entry : actualSnapshotsInProgress.entries()) {
Expand Down

0 comments on commit 606255f

Please sign in to comment.