You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Under the hood we do calculations based on the passed in weight for HTTPRoute services to normalize them into a percentage, which the virtual service splitters end up translating internally to envoy xDS, scaled to its required total weight of 10000 per-route.
When we provide weights that, when summed, don't divide evenly into 10000, we get errors due to errors in float rounding and envoy complains that it requires a total weight of 10000 when doing weighted load-balancing.
Reproduction Steps
Create and attach an HTTPRoute with weights for a set of services that don't divide evenly into 10000, such as:
Rules=[
{
Services = [
{
Name ="service-one"
Weight =2
},
{
Name ="service-two"
Weight =1
}
]
}
]
Here's a simple go snippet of the rounding behavior we're hitting. We should ensure that we handle rounding errors by doing something like adding whatever offset necessary to the highest weighted service in order to normalize all weight percentages to exactly equal 100 (or 10000 when converted to xDS).
The text was updated successfully, but these errors were encountered:
Overview of the Issue
Under the hood we do calculations based on the passed in weight for HTTPRoute services to normalize them into a percentage, which the virtual service splitters end up translating internally to envoy xDS, scaled to its required total weight of 10000 per-route.
consul/agent/consul/discoverychain/gateway_httproute.go
Lines 137 to 141 in 73b9b40
When we provide weights that, when summed, don't divide evenly into 10000, we get errors due to errors in float rounding and envoy complains that it requires a total weight of 10000 when doing weighted load-balancing.
Reproduction Steps
Create and attach an HTTPRoute with weights for a set of services that don't divide evenly into 10000, such as:
Here's a simple go snippet of the rounding behavior we're hitting. We should ensure that we handle rounding errors by doing something like adding whatever offset necessary to the highest weighted service in order to normalize all weight percentages to exactly equal 100 (or 10000 when converted to xDS).
The text was updated successfully, but these errors were encountered: