-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Weighted Routing] Add support for discovered master and remove local weights in the response #5680
[Weighted Routing] Add support for discovered master and remove local weights in the response #5680
Conversation
Signed-off-by: Anshu Agarwal <[email protected]>
Signed-off-by: Anshu Agarwal <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
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:
|
Codecov Report
@@ Coverage Diff @@
## main #5680 +/- ##
============================================
- Coverage 71.11% 71.01% -0.11%
+ Complexity 58641 58600 -41
============================================
Files 4760 4760
Lines 279515 279516 +1
Branches 40348 40347 -1
============================================
- Hits 198782 198491 -291
- Misses 64463 64876 +413
+ Partials 16270 16149 -121
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Anshu Agarwal <[email protected]>
I think we should let this functionality be as is . A local collector could use this to find out weights in a light weight manner , which otherwise would be heavy to go to the cluster manager. |
@anshu1106 can correct me but this doesn't remove |
Got it. My bad, i misread the title . |
@@ -219,7 +219,6 @@ public void testGetWeightedRouting_WeightsAreSet() throws IOException { | |||
.setRequestLocal(true) | |||
.get(); | |||
assertEquals(weightedRouting, weightedRoutingResponse.weights()); | |||
assertEquals("1.0", weightedRoutingResponse.getLocalNodeWeight()); |
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.
add discovered_cluster_manager
assertion as well .
|
||
public String getLocalNodeWeight() { | ||
return localNodeWeight; | ||
public Boolean getDiscoveredMaster() { |
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.
lets use cluster_manager
everywhere . master
is going to get deprecated in 3.0.
Signed-off-by: Anshu Agarwal <[email protected]>
Signed-off-by: Anshu Agarwal <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
0dcfbbd
to
dff4cce
Compare
Gradle Check (Jenkins) Run Completed with:
|
ClusterGetWeightedRoutingResponse() { | ||
this.weightedRouting = null; | ||
this.discoveredClusterManager = null; | ||
} |
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.
There is no explicit need to set them null
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-5680-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 3eaf129b969d7c5dd9b502c747034bd60d8a4591
# Push it to GitHub
git push --set-upstream origin backport/backport-5680-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 |
… weights in the response (opensearch-project#5680) * Add support for discovered master and remove local weights in the weighted routing API response Signed-off-by: Anshu Agarwal <[email protected]>
… weights in the response (opensearch-project#5680) * Add support for discovered master and remove local weights in the weighted routing API response Signed-off-by: Anshu Agarwal <[email protected]>
… weights in the response (opensearch-project#5680) * Add support for discovered master and remove local weights in the weighted routing API response Signed-off-by: Anshu Agarwal <[email protected]>
#5784) * [Weighted Routing] Add support for discovered master and remove local weights in the response (#5680) * Add support for discovered master and remove local weights in the weighted routing API response Signed-off-by: Anshu Agarwal <[email protected]> * [Weighted Shard Routing] API versioning (#5255) * Support API versioning for weighted shard routing Signed-off-by: Anshu Agarwal <[email protected]> * [Weighted Shard Routing] Fail open requests on search shard failures (#5072) * Fail open requests on search shard failures ( Signed-off-by: Anshu Agarwal <[email protected]> * Address fail open comments (#5778) [Weighted Shard Routing] Refactor and fix singleton in FailAwareWeightedRouting Signed-off-by: Anshu Agarwal <[email protected]> * remove unintended changes in changelog Signed-off-by: Anshu Agarwal <[email protected]> * remove unintended changes from changelog Signed-off-by: Anshu Agarwal <[email protected]> Signed-off-by: Anshu Agarwal <[email protected]> Co-authored-by: Anshu Agarwal <[email protected]>
…ed shard routing (#5781) * [Backport 2.x] [Weighted Shard Routing] Add support for discovered master and remove local weights in the response #5680 [Weighted Shard Routing] API versioning #5255 [Weighted Shard Routing] Fail open requests on search shard failures #5072 [Weighted Shard Routing] Refactor and fix singleton in FailAwareWeightedRouting #5778 Signed-off-by: Anshu Agarwal <[email protected]>
…ed shard routing (#5781) * [Backport 2.x] [Weighted Shard Routing] Add support for discovered master and remove local weights in the response #5680 [Weighted Shard Routing] API versioning #5255 [Weighted Shard Routing] Fail open requests on search shard failures #5072 [Weighted Shard Routing] Refactor and fix singleton in FailAwareWeightedRouting #5778 Signed-off-by: Anshu Agarwal <[email protected]>
Signed-off-by: Anshu Agarwal [email protected]
Description
The local weights don't add much value since weights are relative and having just the local value gives no indication of how traffic would get distributed.
Discovered master is helpful to understand cases where after weights are set and also that the node is unable to connect to the leader either due to
Master not discovered -- This might happen to newly launched after decommission or even otherwise
Decommissioned -- The node was decommissioned
Issues Resolved
[List any issues this PR will resolve]
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.