On Thu, Oct 17, 2019 at 5:35 AM Daniel Corbett <dcorb...@haproxy.com> wrote:
> Hello, > > > In #48 it was reported that when using the server-template > > directive combined with an SRV record that HAProxy would > always set the weight to "1" regardless of what the SRV record > contains. > > It was found that in an attempt to force a minimum value of "1" > actually ended up forcing "1" in all situations. This was due to > an improper equation: ( x / 256 ) + 1 > > This patch should be backported to 1.8 and 1.9 > > > > Thanks, > > -- Daniel > > > 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. As a conclusion, please don't apply this patch. Baptiste