-
Notifications
You must be signed in to change notification settings - Fork 141
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
Fix record skipping when querying paginated data across shards #3061
Fix record skipping when querying paginated data across shards #3061
Conversation
Signed-off-by: Simeon Widdis <[email protected]>
ba741cd
to
e143507
Compare
Signed-off-by: Simeon Widdis <[email protected]>
3946e6a
to
a8af162
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it impact Join in legacy module also?
integ-test/src/test/java/org/opensearch/sql/sql/PaginationWindowIT.java
Outdated
Show resolved
Hide resolved
@@ -189,6 +189,9 @@ public OpenSearchResponse searchWithPIT(Function<SearchRequest, SearchResponse> | |||
// Set sort field for search_after | |||
if (this.sourceBuilder.sorts() == null) { | |||
this.sourceBuilder.sort(DOC_FIELD_NAME, ASC); | |||
// Workaround to preserve sort location more exactly, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is workaround, could u add the long-term solution issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opensearch/src/main/java/org/opensearch/sql/opensearch/request/OpenSearchQueryRequest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx!
what is the plan for Join in legacy module? |
Signed-off-by: Simeon Widdis <[email protected]>
legacy/src/main/java/org/opensearch/sql/legacy/query/DefaultQueryAction.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Simeon Widdis <[email protected]>
Signed-off-by: Simeon Widdis <[email protected]>
Signed-off-by: Simeon Widdis <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx!
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/sql/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/sql/backport-2.x
# Create a new branch
git switch --create backport/backport-3061-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e838e46f20c164fe00a907725034ea9896b90f93
# Push it to GitHub
git push --set-upstream origin backport/backport-3061-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.x Then, create a pull request where the |
Description
When pulling unordered data from an index with multiple shards, data gets lost if the fetchSize is not a multiple of the shard count, as the persisted cursor position to continue paging is based on the last seen
_doc
which is duplicated when the primary shard count exceeds 1. This PR currently adds a reproducer for the bug -- finding a fix is still in progress.Related Issues
#3064
Check List
--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.