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] Fix DerivedFieldQuery to support concurrent search. #15454

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

Backport c771bdd from #15326.

* Fix DerivedFieldQuery to support concurrent search.

This change updates DerivedFieldQuery to create a separate ValueFetcher instance per thread.
The DerivedFieldValueFetcher is not thread safe in that it holds a ref to a compiled DerivedFieldScript that is
created per thread.  Each script also holds a SourceLookup object that is not thread safe.

Signed-off-by: Marc Handalian <[email protected]>

* Fix broken cases relying on ObjectDerivedFieldValueFetcher.

DerivedFieldQuery will accept a supplier for a valueFetcher rather than constructing it.
This ensures that the DerivedFieldType creating the query (obj or regular) passes the correct supplier func.

Signed-off-by: Marc Handalian <[email protected]>

* remove unused clone method

Signed-off-by: Marc Handalian <[email protected]>

* Add changelog entry

Signed-off-by: Marc Handalian <[email protected]>

* add an extra test for DerivedFieldType multiPhraseQuery

Signed-off-by: Marc Handalian <[email protected]>

* more coverage

Signed-off-by: Marc Handalian <[email protected]>

* add tests for normalizedWildcard and phrase prefix

Signed-off-by: Marc Handalian <[email protected]>

---------

Signed-off-by: Marc Handalian <[email protected]>
(cherry picked from commit c771bdd)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

❕ Gradle check result for 144c309: 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.

Copy link

codecov bot commented Aug 27, 2024

Codecov Report

Attention: Patch coverage is 72.22222% with 5 lines in your changes missing coverage. Please review.

Project coverage is 71.69%. Comparing base (e80c06e) to head (144c309).
Report is 1 commits behind head on 2.x.

Files Patch % Lines
.../org/opensearch/index/mapper/DerivedFieldType.java 66.66% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                2.x   #15454      +/-   ##
============================================
+ Coverage     71.64%   71.69%   +0.04%     
- Complexity    63462    63539      +77     
============================================
  Files          5213     5213              
  Lines        297357   297358       +1     
  Branches      43283    43283              
============================================
+ Hits         213042   213176     +134     
+ Misses        66497    66363     -134     
- Partials      17818    17819       +1     

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

@mch2 mch2 merged commit d0d7999 into 2.x Aug 28, 2024
58 checks passed
@mch2 mch2 deleted the backport/backport-15326-to-2.x branch August 28, 2024 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant