Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] Optimize UnsignedLong range queries to convert to MatchNoDocsQuery when lower > upper bounds #14483

Merged

Conversation

Skyring100
Copy link
Contributor

@Skyring100 Skyring100 commented Jun 20, 2024

Description

Backport #14416 to 2.x
unsignedLongRangeQuery method now returns MatchNoDocsQuery when lower bound > upper bound

Related Issues

Resolves #14404

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@github-actions github-actions bot added enhancement Enhancement or improvement to existing feature or request good first issue Good for newcomers Search:Performance v2.16.0 Issues and PRs related to version 2.16.0 v3.0.0 Issues and PRs related to version 3.0.0 labels Jun 20, 2024
@jed326
Copy link
Collaborator

jed326 commented Jun 20, 2024

@Skyring100 looks like something went wrong here. Can you make sure the PR targets the 2.x branch instead of main?

Copy link
Contributor

❌ Gradle check result for 8148e4d: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@Skyring100
Copy link
Contributor Author

@jed326 when I try to switch the branch I'm committing to '2.x', GitHub claims there are no new commits between it and my own branch. Was there a different branch I am supposed to commit to?

@jed326
Copy link
Collaborator

jed326 commented Jun 21, 2024

@Skyring100 looking at the branch this PR is opened from, https://github.com/Skyring100/OpenSearch/commits/backport/backport-14416-to-2.x/, I don't see the commit you are trying to backport on the branch.

Based on your comment #14416 (comment) it looks like the cherry-pick didn't go through for some reason. My guess is that the commit was squashed and then wasn't fetched to your fork yet, there should be an option in the GitHub UI on https://github.com/Skyring100/OpenSearch/tree/main to sync your fork. Can you make sure that the commit d2c08b3 is present on the main branch of your fork and then try to cherry-pick it to your backport/backport-14416-to-2.x branch?

@jed326 jed326 changed the title Backport/backport 14416 to 2.x [Backport 2.x] Optimize UnsignedLong range queries to convert to MatchNoDocsQuery when lower > upper bounds Jun 21, 2024
@gaobinlong
Copy link
Collaborator

@Skyring100 here are the steps that can help resolving the problem in this PR:
in your local OpenSearch directory, execute:

  1. git fetch upstream main
  2. git fetch upstream 2.x
  3. git checkout backport/backport-14416-to-2.x
  4. git reset --hard upstream/2.x
  5. git cherry-pick d2c08b320b49920e142ec70fa66621305fd4ccf8
  6. resolve the conflicts if exist
  7. git add .
  8. git cherry-pick --continue
  9. git push --force origin backport/backport-14416-to-2.x

note that upstream points to the official repository, and origin points to your forked repository in github, you can change the name if they're different from mine:
image

@Skyring100
Copy link
Contributor Author

@gaobinlong I followed these steps but I did realized I didn't use the "signoff" flag for some of the last commits, is there a fast way to fix this?

Copy link
Contributor

❕ Gradle check result for d8397c1: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@gaobinlong
Copy link
Collaborator

@gaobinlong I followed these steps but I did realized I didn't use the "signoff" flag for some of the last commits, is there a fast way to fix this?

The commit in this PR should be merge into the 2.x branch, you chose the wrong branch which is main, you can close this PR and open a new one, then I think no DCO issue will occur.
image

…en lower > upper bounds (opensearch-project#14416)

* Added check for lower > upper at end of function

Signed-off-by: Skyring100 <[email protected]>

* Fixed mistake of using < operator on BigInteger, now using compareTo

Signed-off-by: Skyring100 <[email protected]>

* Fixed simple mistake of flipping > operator

Signed-off-by: Skyring100 <[email protected]>

* Fixed space formatting

Signed-off-by: Skyring100 <[email protected]>

* Updated CHANGELOG.md

Signed-off-by: Skyring100 <[email protected]>

* Issue number linked in CHANGELOG.md

Signed-off-by: Skyring100 <[email protected]>

* doTestDocValueRangeQueries now accepts MatchNoDocsQuery alongside IndexOrDocValuesQuery

Signed-off-by: Skyring100 <[email protected]>

* dotestdoTestDocValueRangeQueries only checks indexQuery and randomAccessQuery only when query is type IndexIndexOrDocValuesQuery

Signed-off-by: Skyring100 <[email protected]>

* Ran gradlew spotlessApply to fix import formatting issues

Signed-off-by: Skyring100 <[email protected]>

* Imported Matchers.either method instead of entire Matchers class

Signed-off-by: Skyring100 <[email protected]>

---------

Signed-off-by: Skyring100 <[email protected]>
Signed-off-by: Andriy Redko <[email protected]>
Co-authored-by: Andriy Redko <[email protected]>
(cherry picked from commit d2c08b3)
Signed-off-by: Andriy Redko <[email protected]>
@reta reta force-pushed the backport/backport-14416-to-2.x branch from 84a4a3b to 98ae9ce Compare June 21, 2024 13:00
@reta
Copy link
Collaborator

reta commented Jun 21, 2024

@Skyring100 fixed the pull request, thanks for help @gaobinlong & @jed326 !

Copy link
Contributor

❌ Gradle check result for 84a4a3b: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 98ae9ce: null

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 98ae9ce: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 98ae9ce: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 98ae9ce: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

✅ Gradle check result for 98ae9ce: SUCCESS

@reta reta merged commit 75196a7 into opensearch-project:2.x Jun 21, 2024
30 checks passed
@Skyring100
Copy link
Contributor Author

Thank you all for helping me out so much, it's very much appreciated

kkewwei pushed a commit to kkewwei/OpenSearch that referenced this pull request Jul 24, 2024
…en lower > upper bounds (opensearch-project#14416) (opensearch-project#14483)

* Added check for lower > upper at end of function

* Fixed mistake of using < operator on BigInteger, now using compareTo

* Fixed simple mistake of flipping > operator

* Fixed space formatting

* Updated CHANGELOG.md

* Issue number linked in CHANGELOG.md

* doTestDocValueRangeQueries now accepts MatchNoDocsQuery alongside IndexOrDocValuesQuery

* dotestdoTestDocValueRangeQueries only checks indexQuery and randomAccessQuery only when query is type IndexIndexOrDocValuesQuery

* Ran gradlew spotlessApply to fix import formatting issues

* Imported Matchers.either method instead of entire Matchers class

---------

(cherry picked from commit d2c08b3)

Signed-off-by: Skyring100 <[email protected]>
Signed-off-by: Andriy Redko <[email protected]>
Co-authored-by: Andriy Redko <[email protected]>
Signed-off-by: kkewwei <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or improvement to existing feature or request good first issue Good for newcomers Search:Performance v2.16.0 Issues and PRs related to version 2.16.0 v3.0.0 Issues and PRs related to version 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Optimize UnsignedLong range queries to convert to MatchNoDocsQuery when lower > upper bounds
4 participants