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

[Bugfix] Pass TwoPhaseIterator from subQueryScorer #11954

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

noCharger
Copy link
Contributor

@noCharger noCharger commented Jan 19, 2024

Description

This is a bug when _score is included in script, and the TwoPhaseIterator of a MinScoreScorer doesn't check the ScriptScorer for a match before asking it for a score for the current doc:

// we need to check the two-phase iterator first
// otherwise calling score() is illegal
if (inTwoPhase != null && inTwoPhase.matches() == false) {
return false;
}
curScore = in.score();

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

#8155

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.

@noCharger noCharger added skip-changelog v2.12.0 Issues and PRs related to version 2.12.0 labels Jan 19, 2024
Copy link
Contributor

github-actions bot commented Jan 19, 2024

Compatibility status:

Checks if related components are compatible with change 57a2d5b

Incompatible components

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/flow-framework.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/performance-analyzer.git]

@deshsidd
Copy link
Contributor

Please sign your commits and fix the builds.

@deshsidd
Copy link
Contributor

Can we also add some tests to verify this behavior before and after. thanks

@noCharger
Copy link
Contributor Author

Please sign your commits and fix the builds.

Hi @deshsidd, this PR is still in progress. Please take look when it's ready for review.

Copy link
Contributor

✅ Gradle check result for b878dcf: SUCCESS

Copy link

codecov bot commented Jan 19, 2024

Codecov Report

Attention: 138 lines in your changes are missing coverage. Please review.

Comparison is base (3cbf54e) 71.40% compared to head (57a2d5b) 71.37%.
Report is 8 commits behind head on main.

Files Patch % Lines
...rch/search/fetch/subphase/MatchedQueriesPhase.java 0.00% 37 Missing ⚠️
...src/main/java/org/opensearch/search/SearchHit.java 58.73% 17 Missing and 9 partials ⚠️
...ansport/top_queries/TransportTopQueriesAction.java 24.00% 18 Missing and 1 partial ⚠️
.../insights/core/listener/QueryInsightsListener.java 73.58% 10 Missing and 4 partials ⚠️
...opensearch/search/builder/SearchSourceBuilder.java 42.85% 4 Missing and 4 partials ⚠️
.../resthandler/top_queries/RestTopQueriesAction.java 61.11% 7 Missing ⚠️
.../insights/rules/action/top_queries/TopQueries.java 66.66% 5 Missing ⚠️
...search/ingest/common/RemoveByPatternProcessor.java 95.77% 1 Missing and 2 partials ⚠️
...s/rules/action/top_queries/TopQueriesResponse.java 93.18% 3 Missing ⚠️
...g/opensearch/search/internal/SubSearchContext.java 0.00% 3 Missing ⚠️
... and 8 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11954      +/-   ##
============================================
- Coverage     71.40%   71.37%   -0.04%     
- Complexity    59636    59687      +51     
============================================
  Files          4944     4952       +8     
  Lines        280322   280638     +316     
  Branches      40728    40773      +45     
============================================
+ Hits         200175   200313     +138     
- Misses        63501    63678     +177     
- Partials      16646    16647       +1     

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

@noCharger noCharger force-pushed the bugfix-script-scorer branch from b878dcf to e364dc6 Compare February 6, 2024 21:40
Copy link
Contributor

github-actions bot commented Feb 6, 2024

❌ Gradle check result for e364dc6:

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?

@msfroh msfroh added backport 2.x Backport to 2.x branch backport 2.12 Backport to 2.12 branch labels Feb 6, 2024
Copy link
Contributor

github-actions bot commented Feb 7, 2024

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

@noCharger
Copy link
Contributor Author

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

All failes are flaky test cases https://build.ci.opensearch.org/job/gradle-check/33431/testReport/

Ref #7755

@noCharger noCharger force-pushed the bugfix-script-scorer branch from cdc3cae to 57a2d5b Compare February 7, 2024 00:37
Copy link
Contributor

github-actions bot commented Feb 7, 2024

✅ Gradle check result for 57a2d5b: SUCCESS

@msfroh msfroh merged commit 0d50525 into opensearch-project:main Feb 7, 2024
29 of 30 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 7, 2024
(cherry picked from commit 0d50525)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 7, 2024
(cherry picked from commit 0d50525)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
reta pushed a commit that referenced this pull request Feb 7, 2024
(cherry picked from commit 0d50525)
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>
reta pushed a commit that referenced this pull request Feb 7, 2024
(cherry picked from commit 0d50525)
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>
peteralfonsi pushed a commit to peteralfonsi/OpenSearch that referenced this pull request Mar 1, 2024
rayshrey pushed a commit to rayshrey/OpenSearch that referenced this pull request Mar 18, 2024
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
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 2.12 Backport to 2.12 branch skip-changelog v2.12.0 Issues and PRs related to version 2.12.0
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants