Prefer the load_balancing_policy cluster field over lb_policy#18419
Prefer the load_balancing_policy cluster field over lb_policy#18419lizan merged 9 commits intoenvoyproxy:mainfrom
Conversation
|
Hi @temawi, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
There was a problem hiding this comment.
Naming this is hard! This is the best I could think of, but it's still a bit confusing as it's somewhat overloaded with the LOAD_BALANCING_POLICY_CONFIG enum value.
There was a problem hiding this comment.
Yeah, this name is probably fine.
Please add a [#not-implemented-hide:] annotation here to hide this from the Envoy docs until it is actually implemented in Envoy.
There was a problem hiding this comment.
I'd like to push back on the name a bit. I feel it's just too easy to confuse this with the existing same-typed field.
Why can't we just change semantics of the existing field such that if a non-LOAD_BALANCING_POLICY_CONFIG policy is set, and load_balancing_policy is set as well, that we have the intended fallback behaviors?
This would have the same behavior as today if LOAD_BALANCING_POLICY_CONFIG and load_balancing_policy are set and still provide the desired fallback behavior for older clients?
There was a problem hiding this comment.
That sounds okay to me. The only real impact of that would be that if the control plane populates the load_balancing_policy field but does not set the enum to LOAD_BALANCING_POLICY_CONFIG, then very recent versions of Envoy that include #17400 would react as if they did not support load_balancing_policy at all.
@pianiststickman, does that sound okay to you?
There was a problem hiding this comment.
I believe we have consensus on reusing the existing load_balancing_config field. Old clients will look at the field if LOAD_BALANCING_POLICY_CONFIG is set in lb_policy, but this approach is getting marked as deprecated in this PR. The approach going forward is to only consider load_balancing_config for all LB configuration. Please take a look if the changes I made look ok.
There was a problem hiding this comment.
Sorry for the late reply - yes, that sounds fine to me. AIUI there is no change if the management server still populates load_balancing_policy and continues to set the enum to LOAD_BALANCING_POLICY_CONFIG.
Of course that raises a different question - if eventually the client will just look at load_balancing_policy and not at the enum value, then does LOAD_BALANCING_POLICY_CONFIG really have a purpose? Should it be deprecated?
There was a problem hiding this comment.
No, LOAD_BALANCING_POLICY_CONFIG is no longer needed. We're deprecating it as part of this PR.
markdroth
left a comment
There was a problem hiding this comment.
Thanks for doing this!
Note that you'll need to run ./ci/run_envoy_docker.sh './ci/do_ci.sh fix_format' to generate the shadow proto files and add the changes to this PR.
Please let me know if you have any questions. Thanks!
There was a problem hiding this comment.
Yeah, this name is probably fine.
Please add a [#not-implemented-hide:] annotation here to hide this from the Envoy docs until it is actually implemented in Envoy.
markdroth
left a comment
There was a problem hiding this comment.
I'm wondering if we can make the code change to Envoy to always prefer load_balancing_policy to lb_policy as part of this PR. Ideally, that should be fairly simple to do, but if we let this go for a long time before making that change, it will make life much harder for control planes.
There was a problem hiding this comment.
I think we should just change this comment to say:
If this field is set and is supported by the client, it will supercede the value of
:ref:`lb_policy<envoy_v3_api_field_config.cluster.v3.Cluster.lb_policy>`.
|
To @markdroth's point, the change to do this in Envoy would be very small, probably a few lines in upstream_impl.cc where |
I made the change and added some unit tests. |
|
@lizan can you provide non-Googler API and implementation review coverage on this one? Thanks. |
|
Thanks for making that change -- this looks great! It looks like there are some CI failures to be resolved. |
|
Changes looks good, can you fix DCO? |
This adds a new LB policy mechanism over the existing lb_policy and load_balancing_policy fields, which it deprecates. This change allows for a more flexible configuration of defining a heterogenous list of built-in and custom load balancers while still preserving backward compatibility, allowing the old fields to be used by older clients . Signed-off-by: Terry Wilson <tmwilson@google.com>
This adds a new LB policy mechanism over the existing lb_policy and load_balancing_policy fields, which it deprecates. This change allows for a more flexible configuration of defining a heterogenous list of built-in and custom load balancers while still preserving backward compatibility, allowing the old fields to be used by older clients . Signed-off-by: Terry Wilson <tmwilson@google.com>
Signed-off-by: Terry Wilson <tmwilson@google.com>
Signed-off-by: Terry Wilson <tmwilson@google.com>
Not supported in enum values. Signed-off-by: Terry Wilson <tmwilson@google.com>
Signed-off-by: Terry Wilson <tmwilson@google.com>
Signed-off-by: Terry Wilson <tmwilson@google.com>
Signed-off-by: Terry Wilson <tmwilson@google.com>
Signed-off-by: Terry Wilson <tmwilson@google.com>
|
@lizan DCO is now taken care of but I ended up dismissing your approval by making some formatting changes. Can you re-approve, please? |
This change updates Envoy to consider the load balancing configuration
set in load_balancing_policy, regardless of what is set in lb_policy.
Previously the load_balancing_policy field was only considered if lb_policy
was set to LOAD_BALANCING_POLICY_CONFIG.
Going forward the approach is to only use the load_balancing_policy field
and the extensible configuration mechanism it provides to configure
all load balancing policies, which makes lb_policy deprecated.
This change still preserves backward compatibility, allowing old clients
to continue using the lb_policy field and new ones to switch to just
considering load_balancing_policy.
Commit Message: Prefer the load_balancing_policy cluster field over lb_policy
Additional Description: This change updates Envoy to consider the load
balancing configuration set in load_balancing_policy, regardless of what
is set in lb_policy.
Risk Level: Low
Testing: New unit tests for upstream_impl.cc
Docs Changes: Documentation to follow once consensus on this
change is reached.
Release Notes: Not currently user impacting as backward compatibility
is maintained.
Platform Specific Features: None.
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]