Skip to content

Commit 28354f5

Browse files
authored
Fix hidden alias serialization version checks (#53249)
This commit corrects the serialization versions for hidden alias data following the backport of #52547.
1 parent 3e158e1 commit 28354f5

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ task verifyVersions {
220220
* after the backport of the backcompat code is complete.
221221
*/
222222

223-
boolean bwc_tests_enabled = false
224-
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/52547" // backport thereof
223+
boolean bwc_tests_enabled = true
224+
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
225225
if (bwc_tests_enabled == false) {
226226
if (bwc_tests_disabled_issue.isEmpty()) {
227227
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")

server/src/main/java/org/elasticsearch/action/admin/indices/alias/Alias.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public Alias(StreamInput in) throws IOException {
7575
indexRouting = in.readOptionalString();
7676
searchRouting = in.readOptionalString();
7777
writeIndex = in.readOptionalBoolean();
78-
if (in.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO fix for backport of https://github.com/elastic/elasticsearch/pull/52547
78+
if (in.getVersion().onOrAfter(Version.V_7_7_0)) {
7979
isHidden = in.readOptionalBoolean();
8080
}
8181
}
@@ -219,7 +219,7 @@ public void writeTo(StreamOutput out) throws IOException {
219219
out.writeOptionalString(indexRouting);
220220
out.writeOptionalString(searchRouting);
221221
out.writeOptionalBoolean(writeIndex);
222-
if (out.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO fix for backport of https://github.com/elastic/elasticsearch/pull/52547
222+
if (out.getVersion().onOrAfter(Version.V_7_7_0)) {
223223
out.writeOptionalBoolean(isHidden);
224224
}
225225
}

server/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public AliasActions(StreamInput in) throws IOException {
251251
searchRouting = in.readOptionalString();
252252
indexRouting = in.readOptionalString();
253253
writeIndex = in.readOptionalBoolean();
254-
if (in.getVersion().onOrAfter(Version.V_8_0_0)) { //TODO fix for backport of https://github.com/elastic/elasticsearch/pull/52547
254+
if (in.getVersion().onOrAfter(Version.V_7_7_0)) {
255255
isHidden = in.readOptionalBoolean();
256256
}
257257
originalAliases = in.readStringArray();
@@ -267,7 +267,7 @@ public void writeTo(StreamOutput out) throws IOException {
267267
out.writeOptionalString(searchRouting);
268268
out.writeOptionalString(indexRouting);
269269
out.writeOptionalBoolean(writeIndex);
270-
if (out.getVersion().onOrAfter(Version.V_8_0_0)) { //TODO fix for backport https://github.com/elastic/elasticsearch/pull/52547
270+
if (out.getVersion().onOrAfter(Version.V_7_7_0)) {
271271
out.writeOptionalBoolean(isHidden);
272272
}
273273
out.writeStringArray(originalAliases);

server/src/main/java/org/elasticsearch/cluster/metadata/AliasMetaData.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public void writeTo(StreamOutput out) throws IOException {
198198
}
199199
out.writeOptionalBoolean(writeIndex());
200200

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

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

0 commit comments

Comments
 (0)