Skip to content

Commit

Permalink
Adapt serialization version checks in ShardSearchRequest (#53660)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jimczi committed Mar 18, 2020
1 parent dfb779e commit de9e44f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ task verifyVersions {
* after the backport of the backcompat code is complete.
*/

boolean bwc_tests_enabled = true
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
boolean bwc_tests_enabled = false
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/53659" /* 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 @@ -179,12 +179,9 @@ public ShardSearchRequest(StreamInput in) throws IOException {
preference = in.readOptionalString();
if (in.getVersion().onOrAfter(Version.V_7_7_0)) {
canReturnNullResponseIfMatchNoDocs = in.readBoolean();
} else {
canReturnNullResponseIfMatchNoDocs = false;
}
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
bottomSortValues = in.readOptionalWriteable(SearchSortValuesAndFormats::new);
} else {
canReturnNullResponseIfMatchNoDocs = false;
bottomSortValues = null;
}
originalIndices = OriginalIndices.readOriginalIndices(in);
Expand Down Expand Up @@ -223,8 +220,6 @@ protected final void innerWriteTo(StreamOutput out, boolean asKey) throws IOExce
}
if (out.getVersion().onOrAfter(Version.V_7_7_0)) {
out.writeBoolean(canReturnNullResponseIfMatchNoDocs);
}
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
out.writeOptionalWriteable(bottomSortValues);
}
}
Expand Down

0 comments on commit de9e44f

Please sign in to comment.