-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Handle canMatchSearchAfter for frozen context scenario #11249
Conversation
Signed-off-by: Chaitanya Gohel <[email protected]>
❕ Gradle check result for a615371: 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. |
❌ Gradle check result for 7b8eeec: 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? |
Those are indeed flaky till we get it to 2.12 (backport) |
Signed-off-by: Chaitanya Gohel <[email protected]>
@gashutos sorry but we have merge conflict here ... |
Signed-off-by: Chaitanya Gohel <[email protected]>
Oops, resolved just now. |
❌ Gradle check result for d552d15: 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? |
❌ Gradle check result for d552d15: 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? |
❕ Gradle check result for d552d15: 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. |
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-11249-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 280f6e488c97e7e4429472b100713d8b7231f38a
# Push it to GitHub
git push --set-upstream origin backport/backport-11249-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x Then, create a pull request where the |
@gashutos could you please manually backport to |
…oject#11249) * Handle canMatchSearchAfter for frozen context scenario Signed-off-by: Chaitanya Gohel <[email protected]> * Addressig review comments Signed-off-by: Chaitanya Gohel <[email protected]> * Enable test for 2.12.0 for nano date now Signed-off-by: Chaitanya Gohel <[email protected]> --------- Signed-off-by: Chaitanya Gohel <[email protected]> Signed-off-by: Chaitanya Gohel <[email protected]>
…oject#11249) * Handle canMatchSearchAfter for frozen context scenario Signed-off-by: Chaitanya Gohel <[email protected]> * Addressig review comments Signed-off-by: Chaitanya Gohel <[email protected]> * Enable test for 2.12.0 for nano date now Signed-off-by: Chaitanya Gohel <[email protected]> --------- Signed-off-by: Chaitanya Gohel <[email protected]> Signed-off-by: Chaitanya Gohel <[email protected]>
Using the latest docker version (opensearchproject/opensearch:latest) fails with this error. Curiously the latest version of the AWS service does not. |
The latest image is
This fix will be available in 2.12 release -> schedule. For AWS managed OpenSearch services, we have different release schedule and we patched this fix to 2.11 AOS version itself. |
…oject#11249) * Handle canMatchSearchAfter for frozen context scenario Signed-off-by: Chaitanya Gohel <[email protected]> * Addressig review comments Signed-off-by: Chaitanya Gohel <[email protected]> * Enable test for 2.12.0 for nano date now Signed-off-by: Chaitanya Gohel <[email protected]> --------- Signed-off-by: Chaitanya Gohel <[email protected]> Signed-off-by: Chaitanya Gohel <[email protected]>
…oject#11249) * Handle canMatchSearchAfter for frozen context scenario Signed-off-by: Chaitanya Gohel <[email protected]> * Addressig review comments Signed-off-by: Chaitanya Gohel <[email protected]> * Enable test for 2.12.0 for nano date now Signed-off-by: Chaitanya Gohel <[email protected]> --------- Signed-off-by: Chaitanya Gohel <[email protected]> Signed-off-by: Chaitanya Gohel <[email protected]> Signed-off-by: Shivansh Arora <[email protected]>
Description
There is a corner case where sort is failing on nested field after this PR #7453. When nested field is
date
type and havefilter
in nested field hasnow()
function call.OpenSearch prevents SortFields' initialization in such cases more then one time.
This is very corner scenario but I added integ tests for that as we didn't have any integ test.
As a mitigation, I am pssing already initialized
SortAndFormats
in ContextIndexSearcher in this PR. In fact I also made change to invoke thatif clause
only if SearchContext contains searchAfter.This happens only when nested_sort is having date field type and filter is having range along with now(). Culprit is the now() call that Opensearch is trying to avoid since now() should get called only once.
How to repro the issue
This search query failes with below Exception,
Server side traces are corelated with canMatchSearchAfter where we are trying to initialize SortAndFormats again to get MinMax values.
Related Issues
Resolves #11248
Check List
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.