-
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
Disallow search request with preference parameter when weighted routing enabled #5874
Disallow search request with preference parameter when weighted routing enabled #5874
Conversation
Signed-off-by: Anshu Agarwal <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Anshu Agarwal <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
|
||
assertThrows( | ||
PreferenceBasedSearchNotAllowedException.class, | ||
() -> internalCluster().client(nodeMap.get("b").get(0)).prepareSearch().setSize(0).setPreference("_only_local").get() |
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.
can we add randomBetween(local, node_id, only_node) jus to cover all preference options
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.
addressed
Signed-off-by: Anshu Agarwal <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ Coverage Diff @@
## main #5874 +/- ##
============================================
- Coverage 70.88% 70.84% -0.04%
+ Complexity 58720 58714 -6
============================================
Files 4768 4769 +1
Lines 280575 280588 +13
Branches 40514 40515 +1
============================================
- Hits 198881 198784 -97
- Misses 65334 65534 +200
+ Partials 16360 16270 -90
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-5874-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 60db7b5dee6035754d9e4ee49b31f895f176282e
# Push it to GitHub
git push --set-upstream origin backport/backport-5874-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x Then, create a pull request where the |
…ng enabled (opensearch-project#5874) * Disallow preference search with strict weighted shard routing Signed-off-by: Anshu Agarwal <[email protected]>
…ng enabled (opensearch-project#5874) * Disallow preference search with strict weighted shard routing Signed-off-by: Anshu Agarwal <[email protected]>
…ence parameter when weighted routing enabled (#6042) * Disallow search request with preference parameter when weighted routing enabled (#5874) * Disallow preference search with strict weighted shard routing Signed-off-by: Anshu Agarwal <[email protected]>
This is technically a breaking change correct? From OpenSearch Dashboards perspective, by default we pass the value from OpenSearch on the request with a session ID so that it restricts operations to execute all search requests on the same shards. This has the benefit of reusing shard caches across requests. This helps ensure the results are the same per a session based on their sharding strategy. By disallowing this and with our default setting not knowing when weighted routing is enabled then requests will fail. But being that we are only one consumer of the I understand if this is in Disregard if the weighted routing was not release in a previous version. If it did then cc: @joshuarrrr |
@kavilla Weighted routing was introduced in 2.4, though it appears it wasn't documented until 2.5. It does sound like this is a breaking change for 2.x. @Bukhtawar @anshu1106 What do you think? |
Makes sense. Created an issue #6297 to address this. |
Signed-off-by: Anshu Agarwal [email protected]
Description
Disallow search requests with preference parameter in case of strict weighted routing
Issues Resolved
#5873
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.