Skip to content

Commit

Permalink
Fix hidden alias serialization version checks (#53249)
Browse files Browse the repository at this point in the history
This commit corrects the serialization versions for hidden alias data
following the backport of #52547.
  • Loading branch information
gwbrown authored Mar 7, 2020
1 parent 3e158e1 commit 28354f5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ task verifyVersions {
* after the backport of the backcompat code is complete.
*/

boolean bwc_tests_enabled = false
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/52547" // backport thereof
boolean bwc_tests_enabled = true
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
if (bwc_tests_enabled == false) {
if (bwc_tests_disabled_issue.isEmpty()) {
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public Alias(StreamInput in) throws IOException {
indexRouting = in.readOptionalString();
searchRouting = in.readOptionalString();
writeIndex = in.readOptionalBoolean();
if (in.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO fix for backport of https://github.com/elastic/elasticsearch/pull/52547
if (in.getVersion().onOrAfter(Version.V_7_7_0)) {
isHidden = in.readOptionalBoolean();
}
}
Expand Down Expand Up @@ -219,7 +219,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalString(indexRouting);
out.writeOptionalString(searchRouting);
out.writeOptionalBoolean(writeIndex);
if (out.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO fix for backport of https://github.com/elastic/elasticsearch/pull/52547
if (out.getVersion().onOrAfter(Version.V_7_7_0)) {
out.writeOptionalBoolean(isHidden);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public AliasActions(StreamInput in) throws IOException {
searchRouting = in.readOptionalString();
indexRouting = in.readOptionalString();
writeIndex = in.readOptionalBoolean();
if (in.getVersion().onOrAfter(Version.V_8_0_0)) { //TODO fix for backport of https://github.com/elastic/elasticsearch/pull/52547
if (in.getVersion().onOrAfter(Version.V_7_7_0)) {
isHidden = in.readOptionalBoolean();
}
originalAliases = in.readStringArray();
Expand All @@ -267,7 +267,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalString(searchRouting);
out.writeOptionalString(indexRouting);
out.writeOptionalBoolean(writeIndex);
if (out.getVersion().onOrAfter(Version.V_8_0_0)) { //TODO fix for backport https://github.com/elastic/elasticsearch/pull/52547
if (out.getVersion().onOrAfter(Version.V_7_7_0)) {
out.writeOptionalBoolean(isHidden);
}
out.writeStringArray(originalAliases);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public void writeTo(StreamOutput out) throws IOException {
}
out.writeOptionalBoolean(writeIndex());

if (out.getVersion().onOrAfter(Version.V_8_0_0)) { //TODO fix for backport of https://github.com/elastic/elasticsearch/pull/52547
if (out.getVersion().onOrAfter(Version.V_7_7_0)) {
out.writeOptionalBoolean(isHidden);
}
}
Expand All @@ -224,7 +224,7 @@ public AliasMetaData(StreamInput in) throws IOException {
}
writeIndex = in.readOptionalBoolean();

if (in.getVersion().onOrAfter(Version.V_8_0_0)) { //TODO fix for backport of https://github.com/elastic/elasticsearch/pull/52547
if (in.getVersion().onOrAfter(Version.V_7_7_0)) {
isHidden = in.readOptionalBoolean();
} else {
isHidden = null;
Expand Down

0 comments on commit 28354f5

Please sign in to comment.