Skip to content

Commit

Permalink
Adapt serialization version checks in ShardSearchRequest
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 elastic#53659.
Note that this commit also disables the bwc tests temporarily in order to be able to
merge elastic#53659 first.

Relates elastic#51852
  • Loading branch information
jimczi committed Mar 17, 2020
1 parent 68a698f commit 8202873
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 8202873

Please sign in to comment.