OpenSearch
OpenSearch copied to clipboard
Optimize the canMatch phase on the data node
Description
Two changes here:
- short circuit can match check, respond with
CanMatchResponse(false, null)if cannot match(minMaxvalue is useless if corresponding shard is not match); - only primary
searchAfterfield will be evaluated if exists.
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
- [x] Functionality includes testing.
- [x] API changes companion pull request created, if applicable.
- [x] 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.
:white_check_mark: Gradle check result for ada899d32e736538afad67be5287bb9e7dc3a46d: SUCCESS
Codecov Report
Attention: Patch coverage is 60.60606% with 13 lines in your changes missing coverage. Please review.
Project coverage is 71.72%. Comparing base (
49b7cd4) to head (8c91a12). Report is 199 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #14511 +/- ##
============================================
- Coverage 71.84% 71.72% -0.12%
+ Complexity 62820 62720 -100
============================================
Files 5169 5169
Lines 294664 294672 +8
Branches 42615 42621 +6
============================================
- Hits 211691 211344 -347
- Misses 65530 65898 +368
+ Partials 17443 17430 -13
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Is there any way to quantify the impact of this change? Also, are the existing tests sufficient to catch any regressions?
No, this optimization is just for reducing unnecessary computation or IO. Currently, I am unable to accurately measure the impact of this change.
If not, can we add test cases for the missing code paths?
Sure.
:x: Gradle check result for 51866646f1e80e0ac90d08a3bf93619430128548: 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?
@jainankitk friendly ping
@bugmakerrrrrr - While the changes look okay, I am still unsure about the impact and need of this code change. Even if not using some benchmark, having some idea of potential improvement with this change will be good!
Also can you add entry in CHANGELOG.md, before this change can be reviewed by maintainer and merged!
:white_check_mark: Gradle check result for 8c91a1274f52e136e9008d978dade031615cf5ad: SUCCESS
@bugmakerrrrrr - Can you resolve the failing CHANGELOG verifier and codecov check while one of the maintainer reviews this PR?
This PR is stalled because it has been open for 30 days with no activity.