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

Refactor implementations of query phase searcher, add empty QueryCollectorContext #13481

Conversation

martin-gaievski
Copy link
Member

@martin-gaievski martin-gaievski commented May 1, 2024

Description

Current implementations of query phase searcher (default and concurrent) alway adds TopDocsCollector collector to the collector context. In some scenario it's not the preferred behavior, for instance if in a plugin we're adding custom collector that collects doc scores in a different fashion. With current implementation there will be two collectors in the context, this will create a performance overhead.

With this change we're not changing core functionality or implementation of query phase searcher. Instead we're adding overloaded searchWith method that child query phase search can override and pass empty QueryPhaseSearcher.

Related Issues

#13170

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

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.

@martin-gaievski martin-gaievski force-pushed the override_search_with_method_for_query_phase_searcher branch from 6c522fa to e290171 Compare May 1, 2024 00:59
Copy link
Contributor

github-actions bot commented May 1, 2024

❌ Gradle check result for 6c522fa: 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?

@martin-gaievski
Copy link
Member Author

martin-gaievski commented May 1, 2024

this change need to be backported to 2.x, need help from maintainers, I don't have permissions to add a label for backport

@martin-gaievski
Copy link
Member Author

@reta can you please review this change, this is related to #13481? I've tested the PR with corresponding changes at the plugin level, I can created PR for neural-search repo once core change is merged.

Copy link
Contributor

github-actions bot commented May 1, 2024

✅ Gradle check result for e290171: SUCCESS

Copy link

codecov bot commented May 1, 2024

Codecov Report

Attention: Patch coverage is 55.55556% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 71.55%. Comparing base (b15cb0c) to head (d13f4a2).
Report is 252 commits behind head on main.

Files Patch % Lines
...opensearch/search/query/QueryCollectorContext.java 20.00% 4 Missing ⚠️
...rch/search/query/ConcurrentQueryPhaseSearcher.java 60.00% 1 Missing and 1 partial ⚠️
...n/java/org/opensearch/search/query/QueryPhase.java 71.42% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13481      +/-   ##
============================================
+ Coverage     71.42%   71.55%   +0.13%     
- Complexity    59978    61008    +1030     
============================================
  Files          4985     5050      +65     
  Lines        282275   286815    +4540     
  Branches      40946    41554     +608     
============================================
+ Hits         201603   205220    +3617     
- Misses        63999    64647     +648     
- Partials      16673    16948     +275     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@martin-gaievski martin-gaievski force-pushed the override_search_with_method_for_query_phase_searcher branch from d694e2d to 4381743 Compare May 1, 2024 23:11
Copy link
Contributor

github-actions bot commented May 1, 2024

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

github-actions bot commented May 2, 2024

❌ Gradle check result for 8744c3e: 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?

@martin-gaievski martin-gaievski force-pushed the override_search_with_method_for_query_phase_searcher branch from 8744c3e to af14d56 Compare May 2, 2024 00:29
Copy link
Contributor

github-actions bot commented May 2, 2024

❕ Gradle check result for af14d56: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.repositories.azure.AzureBlobContainerRetriesTests.testReadRangeBlobWithRetries

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

Copy link
Contributor

github-actions bot commented May 2, 2024

❌ Gradle check result for 837c4a0: 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?

@martin-gaievski
Copy link
Member Author

@reta can you please help with merging this PR, Jay has approved the PR

@reta
Copy link
Collaborator

reta commented May 2, 2024

@reta can you please help with merging this PR, Jay has approved the PR

Fixing tests with #13510

@reta
Copy link
Collaborator

reta commented May 2, 2024

@martin-gaievski could you please rebase? thank you!

@martin-gaievski martin-gaievski force-pushed the override_search_with_method_for_query_phase_searcher branch from 837c4a0 to d13f4a2 Compare May 2, 2024 17:31
Copy link
Contributor

github-actions bot commented May 2, 2024

✅ Gradle check result for d13f4a2: SUCCESS

@reta reta merged commit 5ff50a7 into opensearch-project:main May 2, 2024
27 of 28 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 2, 2024
…ectorContext (#13481)

* Refactor implementations of query hpase searcher by adding overloaded searchWith method

Signed-off-by: Martin Gaievski <[email protected]>

* Switched to Empty context add rescoring interface

Signed-off-by: Martin Gaievski <[email protected]>

* Changed if by simple null check for querycontext argument

Signed-off-by: Martin Gaievski <[email protected]>

* Added Override annotation for searchWith method

Signed-off-by: Martin Gaievski <[email protected]>

* Remove old override method from Concurrent Query Phase Searcher

Signed-off-by: Martin Gaievski <[email protected]>

---------

Signed-off-by: Martin Gaievski <[email protected]>
(cherry picked from commit 5ff50a7)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
reta pushed a commit that referenced this pull request May 2, 2024
…ectorContext (#13481) (#13512)

* Refactor implementations of query hpase searcher by adding overloaded searchWith method



* Switched to Empty context add rescoring interface



* Changed if by simple null check for querycontext argument



* Added Override annotation for searchWith method



* Remove old override method from Concurrent Query Phase Searcher



---------


(cherry picked from commit 5ff50a7)

Signed-off-by: Martin Gaievski <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
finnegancarroll pushed a commit to finnegancarroll/OpenSearch that referenced this pull request May 10, 2024
…ectorContext (opensearch-project#13481)

* Refactor implementations of query hpase searcher by adding overloaded searchWith method

Signed-off-by: Martin Gaievski <[email protected]>

* Switched to Empty context add rescoring interface

Signed-off-by: Martin Gaievski <[email protected]>

* Changed if by simple null check for querycontext argument

Signed-off-by: Martin Gaievski <[email protected]>

* Added Override annotation for searchWith method

Signed-off-by: Martin Gaievski <[email protected]>

* Remove old override method from Concurrent Query Phase Searcher

Signed-off-by: Martin Gaievski <[email protected]>

---------

Signed-off-by: Martin Gaievski <[email protected]>
deshsidd pushed a commit to deshsidd/OpenSearch that referenced this pull request May 17, 2024
…ectorContext (opensearch-project#13481)

* Refactor implementations of query hpase searcher by adding overloaded searchWith method

Signed-off-by: Martin Gaievski <[email protected]>

* Switched to Empty context add rescoring interface

Signed-off-by: Martin Gaievski <[email protected]>

* Changed if by simple null check for querycontext argument

Signed-off-by: Martin Gaievski <[email protected]>

* Added Override annotation for searchWith method

Signed-off-by: Martin Gaievski <[email protected]>

* Remove old override method from Concurrent Query Phase Searcher

Signed-off-by: Martin Gaievski <[email protected]>

---------

Signed-off-by: Martin Gaievski <[email protected]>
parv0201 pushed a commit to parv0201/OpenSearch that referenced this pull request Jun 10, 2024
…ectorContext (opensearch-project#13481)

* Refactor implementations of query hpase searcher by adding overloaded searchWith method

Signed-off-by: Martin Gaievski <[email protected]>

* Switched to Empty context add rescoring interface

Signed-off-by: Martin Gaievski <[email protected]>

* Changed if by simple null check for querycontext argument

Signed-off-by: Martin Gaievski <[email protected]>

* Added Override annotation for searchWith method

Signed-off-by: Martin Gaievski <[email protected]>

* Remove old override method from Concurrent Query Phase Searcher

Signed-off-by: Martin Gaievski <[email protected]>

---------

Signed-off-by: Martin Gaievski <[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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants