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

Fixed exception in Hybrid Query for one shard and multiple node #396

Conversation

martin-gaievski
Copy link
Member

Description

Fixed case when there is one shard and multiple nodes. In such case Fetch phase all results have doc ids as "-1", and it's not possible to merge them with query results using doc id. Result is a runtime exception in search request.
To fix te problem we're storing doc ids before the normalization and combination is done, and them use docs ids to merge with fetch phase results.

Issues Resolved

#393

Check List

  • All tests pass
  • Commits are signed as per the DCO using --signoff

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 added backport 2.x Label will add auto workflow to backport PR to 2.x branch Bug Fixes Changes to a system or product designed to handle a programming bug/glitch v2.11.0 Issues targeting release v2.11.0 backport 2.11 labels Oct 6, 2023
@codecov
Copy link

codecov bot commented Oct 6, 2023

Codecov Report

Merging #396 (0400f4b) into main (2c79d4d) will decrease coverage by 0.07%.
The diff coverage is 83.33%.

@@             Coverage Diff              @@
##               main     #396      +/-   ##
============================================
- Coverage     84.63%   84.56%   -0.07%     
- Complexity      445      449       +4     
============================================
  Files            38       38              
  Lines          1334     1348      +14     
  Branches        199      201       +2     
============================================
+ Hits           1129     1140      +11     
- Misses          119      120       +1     
- Partials         86       88       +2     
Files Coverage Δ
...arch/processor/NormalizationProcessorWorkflow.java 80.59% <83.33%> (-0.54%) ⬇️

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
@@ -179,4 +179,117 @@ public void testFetchResults_whenOneShardAndQueryAndFetchResultsPresent_thenDoNo
TestUtils.assertQueryResultScores(querySearchResults);
TestUtils.assertFetchResultScores(fetchSearchResult, 4);
}

public void testFetchResults_whenOneShardAndMultipleNodes_thenDoNormalizationCombination() {
Copy link
Member Author

Choose a reason for hiding this comment

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

this test case would fail with old code

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for adding a negative case.

@martin-gaievski martin-gaievski mentioned this pull request Oct 6, 2023
5 tasks
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
@navneet1v navneet1v self-requested a review October 6, 2023 17:22
@martin-gaievski martin-gaievski merged commit 8e98167 into opensearch-project:main Oct 6, 2023
14 of 16 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 6, 2023
* Use list of original doc ids for fetch results

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
(cherry picked from commit 8e98167)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 6, 2023
* Use list of original doc ids for fetch results

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
(cherry picked from commit 8e98167)
martin-gaievski added a commit that referenced this pull request Oct 6, 2023
#400)

* Use list of original doc ids for fetch results

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
(cherry picked from commit 8e98167)

Co-authored-by: Martin Gaievski <gaievski@amazon.com>
martin-gaievski added a commit that referenced this pull request Oct 6, 2023
#399)

* Use list of original doc ids for fetch results

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
(cherry picked from commit 8e98167)

Co-authored-by: Martin Gaievski <gaievski@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Label will add auto workflow to backport PR to 2.x branch backport 2.11 Bug Fixes Changes to a system or product designed to handle a programming bug/glitch v2.11.0 Issues targeting release v2.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants