Skip to content

Commit

Permalink
Update version check after backport
Browse files Browse the repository at this point in the history
Now that the searchable snapshot API change has been backported to 2.x,
the version guard has to change from 3.0 to 2.4.

Signed-off-by: Andrew Ross <andrross@amazon.com>
  • Loading branch information
andrross committed Oct 13, 2022
1 parent 6bae823 commit 3b5dac7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public RestoreSnapshotRequest(StreamInput in) throws IOException {
if (in.getVersion().onOrAfter(LegacyESVersion.V_7_10_0)) {
snapshotUuid = in.readOptionalString();
}
if (FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT) && in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT) && in.getVersion().onOrAfter(Version.V_2_4_0)) {
storageType = in.readEnum(StorageType.class);
}
}
Expand Down Expand Up @@ -182,7 +182,7 @@ public void writeTo(StreamOutput out) throws IOException {
"restricting the snapshot UUID is forbidden in a cluster with version [" + out.getVersion() + "] nodes"
);
}
if (FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT) && out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT) && out.getVersion().onOrAfter(Version.V_2_4_0)) {
out.writeEnum(storageType);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public SnapshotRecoverySource(
} else {
index = new IndexId(in.readString(), IndexMetadata.INDEX_UUID_NA_VALUE);
}
if (FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT) && in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT) && in.getVersion().onOrAfter(Version.V_2_4_0)) {
isSearchableSnapshot = in.readBoolean();
} else {
isSearchableSnapshot = false;
Expand Down Expand Up @@ -330,7 +330,7 @@ protected void writeAdditionalFields(StreamOutput out) throws IOException {
} else {
out.writeString(index.getName());
}
if (FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT) && out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT) && out.getVersion().onOrAfter(Version.V_2_4_0)) {
out.writeBoolean(isSearchableSnapshot);
}
}
Expand Down

0 comments on commit 3b5dac7

Please sign in to comment.