Skip to content

Commit de9e44f

Browse files
authored
Adapt serialization version checks in ShardSearchRequest (#53660)
This change adapts the serialization checks to 7.7.0 in order to cope with #53659. Note that this commit also disables the bwc tests temporarily in order to be able to merge #53659 first. Relates #51852
1 parent dfb779e commit de9e44f

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

build.gradle

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

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

server/src/main/java/org/elasticsearch/search/internal/ShardSearchRequest.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,9 @@ public ShardSearchRequest(StreamInput in) throws IOException {
179179
preference = in.readOptionalString();
180180
if (in.getVersion().onOrAfter(Version.V_7_7_0)) {
181181
canReturnNullResponseIfMatchNoDocs = in.readBoolean();
182-
} else {
183-
canReturnNullResponseIfMatchNoDocs = false;
184-
}
185-
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
186182
bottomSortValues = in.readOptionalWriteable(SearchSortValuesAndFormats::new);
187183
} else {
184+
canReturnNullResponseIfMatchNoDocs = false;
188185
bottomSortValues = null;
189186
}
190187
originalIndices = OriginalIndices.readOriginalIndices(in);
@@ -223,8 +220,6 @@ protected final void innerWriteTo(StreamOutput out, boolean asKey) throws IOExce
223220
}
224221
if (out.getVersion().onOrAfter(Version.V_7_7_0)) {
225222
out.writeBoolean(canReturnNullResponseIfMatchNoDocs);
226-
}
227-
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
228223
out.writeOptionalWriteable(bottomSortValues);
229224
}
230225
}

0 commit comments

Comments
 (0)