upstream: allow a cluster to provide its own load balancer#7081
upstream: allow a cluster to provide its own load balancer#7081
Conversation
Certain clusters have cluster specific load balancers. This change allows a cluster to explicitly provide one, both allowing extension clusters to easily provide a dedicated load balancer, as well as allowing for future cleanup of the original DST LB configuration. This change is needed for Redis Cluster as well as #1606. Signed-off-by: Matt Klein <mklein@lyft.com>
|
@HenryYYang this should be what you need for Redis Cluster. I left you a TODO to implement. I will also build on this for #1606 |
snowp
left a comment
There was a problem hiding this comment.
Looks good to me, just one minor comment
|
I ended up implementing something similar, except I didn't change the ClusterFactory, I put the loadBalancerFactory() method on the cluster object itself. #6895 . Sorry for the miscommunication. |
@HenryYYang I considered doing it this way, but IMO it felt cleaner to have the factory return a single LB at cluster construction time since there should be a 1:1 correspondence between them, vs. an API hanging off a cluster that could be called multiple times. It's a minor point but it felt a bit cleaner to me. @snowp @HenryYYang WDYT? |
Signed-off-by: Matt Klein <mklein@lyft.com>
Yes, both way works. I'll change my code to build on top of this. Thanks 👍 |
|
@mattklein123 from an API perspective, I'm wondering how this interacts with general purpose LB extensibility (#5598). Let's say we want to be able to support:
|
|
@htuch yes exactly. I think we can easily add custom LBs in a similar way that @HenryYYang added custom cluster support. I think in the end we will need all 3 extension points. This change is nice in that it removes a config hack in which a specific LB and cluster need to be configured together for things to work correctly. |
Signed-off-by: Matt Klein <mklein@lyft.com>
snowp
left a comment
There was a problem hiding this comment.
LGTM. +1 to this approach over adding it as a function on the cluster
|
@mattklein123 can we rename to |
IMO these are different cases. In this case, we are saying that the cluster must provide the LB. I think this is different from a custom LB that applies to any cluster? I think in the latter case we would have different config? WDYT? |
|
@mattklein123 ack, that's reasonable, we can have two enum values then. Ship it. |
Certain clusters have cluster specific load balancers. This change
allows a cluster to explicitly provide one, both allowing extension
clusters to easily provide a dedicated load balancer, as well as
allowing for future cleanup of the original DST LB configuration.
This change is needed for Redis Cluster as well as
#1606.
Risk Level: Low
Testing: New UTs and integration tests.
Docs Changes: N/A
Release Notes: N/A