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

Optimize UnsignedLong range queries to convert to MatchNoDocsQuery when lower > upper bounds #14416

Merged
merged 11 commits into from
Jun 20, 2024

Conversation

Skyring100
Copy link
Contributor

Description

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.

Copy link
Contributor

❌ Gradle check result for 4548b63: 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 Skyring100 force-pushed the MatchNoDocsIssue14404 branch from 4548b63 to add784a Compare June 18, 2024 00:13
Copy link
Contributor

❌ Gradle check result for add784a: 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 f23212c: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.action.admin.cluster.node.tasks.ResourceAwareTasksTests.testTaskResourceTrackingDuringTaskCancellation

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

@reta
Copy link
Collaborator

reta commented Jun 19, 2024

LGTM, thanks @Skyring100 ! Could you please resolved the conflicts? Thank you!

@Skyring100
Copy link
Contributor Author

Skyring100 commented Jun 19, 2024

I am not sure how to resolve these conflicts. I could not find the ResourceAwareTasksTests class mentioned in the stacktrace on my local machine. I have locally run ./gradlew precommit and ./gradlew spotlessApply, both of which were successful. Is there something about flaky tests affecting this issue?

@reta reta added backport 2.x Backport to 2.x branch v3.0.0 Issues and PRs related to version 3.0.0 v2.16.0 Issues and PRs related to version 2.16.0 labels Jun 19, 2024
Copy link
Contributor

❌ Gradle check result for a187f9e: 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 a187f9e: 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.

@reta
Copy link
Collaborator

reta commented Jun 20, 2024

@gaobinlong LGTM?

Copy link
Collaborator

@gaobinlong gaobinlong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@reta reta merged commit d2c08b3 into opensearch-project:main Jun 20, 2024
40 of 41 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-14416-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d2c08b320b49920e142ec70fa66621305fd4ccf8
# Push it to GitHub
git push --set-upstream origin backport/backport-14416-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-14416-to-2.x.

@reta
Copy link
Collaborator

reta commented Jun 20, 2024

@Skyring100 could you please send the backport to 2.x branch following the instructions from above? thank you.

@Skyring100
Copy link
Contributor Author

Made the backport pull request though the command "git cherry-pick -x --mainline 1 d2c08b3" returned "fatal: bad object d2c08b3". Hopefully this doesn't cause an issue but provides some more information if there are errors for the request

@Skyring100
Copy link
Contributor Author

I'd like to apologize for how many issues there have been, I was unaware of the knowledge needed beyond my programming skills. Thank you all for having patience and helping with the pull request.

Skyring100 added a commit to Skyring100/OpenSearch that referenced this pull request Jun 21, 2024
…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]>
reta pushed a commit to Skyring100/OpenSearch that referenced this pull request Jun 21, 2024
…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)
reta added a commit to Skyring100/OpenSearch that referenced this pull request Jun 21, 2024
…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 added a commit that referenced this pull request Jun 21, 2024
…en lower > upper bounds (#14416) (#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]>
harshavamsi pushed a commit to harshavamsi/OpenSearch that referenced this pull request Jul 12, 2024
…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]>
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]>
wdongyu pushed a commit to wdongyu/OpenSearch that referenced this pull request Aug 22, 2024
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch backport-failed 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