-
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
Add support for deep copying SearchRequest #12295
Add support for deep copying SearchRequest #12295
Conversation
bc4d842
to
02bf180
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12295 +/- ##
===========================================
Coverage 71.42% 71.42%
+ Complexity 59978 59841 -137
===========================================
Files 4985 4959 -26
Lines 282275 281135 -1140
Branches 40946 40857 -89
===========================================
- Hits 201603 200792 -811
+ Misses 63999 63694 -305
+ Partials 16673 16649 -24 ☔ View full report in Codecov by Sentry. |
This PR is stalled because it has been open for 30 days with no activity. |
@peternied I added a bunch of use cases that can be replaced by this deep clone method in the original issue: #869 (comment) Let me know what you think! thanks! |
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.
Thanks for the references. I suppose the utility of the deep copy could be useful as deep copies are happening in plugins, however, there is a performance trade-off to perform this copy.
For those case that you've reference why is a deep copy needed instead of a 'slim' copy?
server/src/main/java/org/opensearch/action/search/SearchRequest.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/opensearch/action/search/SearchRequestTests.java
Outdated
Show resolved
Hide resolved
Hi @peternied !
For the first use cases I identified (https://github.com/opensearch-project/search-processor/blob/c31475e5465fdce80c7c9b86519a4d8d0141c06b/amazon-kendra-intelligent-ranking/src/main/java/org/opensearch/search/relevance/actionfilter/SearchActionFilter.java#L91), I think we want to rewrite the
I think the use cases are all related to query rewrite/transform. We need to clone a new search query without impacting the original query. But based on the discussions of the original issue, I think we have already validated why this function is much needed. |
❌ Gradle check result for a23b9c2: 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? |
server/src/test/java/org/opensearch/action/search/SearchRequestTests.java
Show resolved
Hide resolved
a23b9c2
to
d77f578
Compare
Hi @peternied! I just updated the PR based on your comments. Let me know it make sense to you. Thank you! |
d77f578
to
4793280
Compare
❌ Gradle check result for d77f578: 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 4793280: 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? |
@ansjcy Please continue iterating to green on the pull request check failures & root cause the test failures (troubleshooting-failing-builds) |
Signed-off-by: Chenyang Ji <[email protected]>
Signed-off-by: Chenyang Ji <[email protected]>
Signed-off-by: Chenyang Ji <[email protected]>
4793280
to
0750906
Compare
❕ Gradle check result for 0750906: 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-12295-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 79957ebc03c4af746a31cdeb47158bad96553505
# Push it to GitHub
git push --set-upstream origin backport/backport-12295-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 |
@ansjcy Could you please manually backport the change to 2.x? |
Signed-off-by: Chenyang Ji <[email protected]>
Signed-off-by: Chenyang Ji <[email protected]>
Signed-off-by: Chenyang Ji <[email protected]>
Description
Add support for deep copying a SearchRequest with roundtriping the request to a stream.
Related Issues
Resolves #869
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.