On Thu, Oct 17, 2019 at 2:32 PM Daniel Corbett <[email protected]> wrote:

> Hello,
> On 10/17/19 1:47 AM, Baptiste wrote:
>
>
>
> Hi Daniel,
>
> Thanks for the patch, but I don't think it's accurate.
> What this part of the code aims to do is to "map" a DNS weight into an
> HAProxy weight.
> There is a ratio of 256 between both: DNS being in range "0-65535" and
> HAProxy in range "0-255".
> What your code does, is that it ignores any DNS weight above 256 and force
> them to 1...
>
> The only "bug" I can see here now is that a server's weight can never be
> 0. But nobody reported this as an issue yet.
>
> I'll check what question is asked into #48 and answer it.
>
>
> Ah ha!  Thanks for the explanation and my apologies for the noise.  This
> makes sense now.
>
> I have put together another patch that I will send later for the
> "resolve-opts ignore-weight" within that same issue report but wanted to
> get this one out first.
>
> Thanks for taking the time to review this Baptiste.
>
> -- Daniel
>

No problem!
I'll fix the documentation and add some comment in the code for the short
term "fix".
I'll also fix the weight at 0 as well asap.

That said, this may be a legitimate feature request: have a "custom" ratio
to apply to DNS weight to map it into HAProxy's weight. Default ratio would
be 256 and if people want to say "DNS weight 50 must match HAProxy weight
of 50" then they could set ratio to 1.
values above 256 will of course be truncated to 256.
(this idea was provided by Willy).
This is a mid term fix and if we see people need that (IE broken DNS server
implementation, etc...).

Baptiste

Reply via email to