-
Notifications
You must be signed in to change notification settings - Fork 4.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
subset lb: allow ring hash/maglev LB to work with subsets #8030
Changes from all commits
3390734
0908fbe
d68384f
e259f47
0bb7ed2
cd2bb3a
9cfabc6
d77bfc2
4161d82
fa295b2
b6f44cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -643,12 +643,24 @@ ClusterInfoImpl::ClusterInfoImpl( | |
envoy::api::v2::Cluster_LbPolicy_Name(config.lb_policy()), | ||
envoy::api::v2::Cluster_DiscoveryType_Name(config.type()))); | ||
} | ||
if (config.has_lb_subset_config()) { | ||
throw EnvoyException( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test? (I think the one below is covered but not this one) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Turns out this isn't reachable because of the check in original_dst_cluster.cc. From the code/comments it seemed the plan was for the original dst cluster to become a custom cluster type to be used in conjunction with That said, I could remove the subset lb check in original_dst_cluster.cc in favor of this one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I'd either suggest a TODO for you to pick up the change which clean this up, or a refactor now, rather than have redundant code in here indefinitely. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I remove the check in the original dst LB. |
||
fmt::format("cluster: LB policy {} cannot be combined with lb_subset_config", | ||
envoy::api::v2::Cluster_LbPolicy_Name(config.lb_policy()))); | ||
} | ||
|
||
lb_type_ = LoadBalancerType::ClusterProvided; | ||
break; | ||
case envoy::api::v2::Cluster::MAGLEV: | ||
lb_type_ = LoadBalancerType::Maglev; | ||
break; | ||
case envoy::api::v2::Cluster::CLUSTER_PROVIDED: | ||
if (config.has_lb_subset_config()) { | ||
throw EnvoyException( | ||
fmt::format("cluster: LB policy {} cannot be combined with lb_subset_config", | ||
envoy::api::v2::Cluster_LbPolicy_Name(config.lb_policy()))); | ||
} | ||
|
||
lb_type_ = LoadBalancerType::ClusterProvided; | ||
break; | ||
default: | ||
|
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.
I'm also inclined to think if we're changing the thread_aware logic we should probably have an integration test for it, as I think the unit tests don't really exercise the therad-aware code. Or am I misremembering?
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.
Do you mean an integration test for subset load balancer + hash-ring or maglev? I can look at adding one.
There are integration tests exercising the hash-ring lb, but not maglev (unless I'm just not seeing it).
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.
yeah, basically my point is this change affects what we do in what thread, in a way that wouldn't be really exercised by unit tests, right?
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.
Added a very basic integration test.