Re: [PATCH] BUG: MAJOR: lb_map: server map calculation broken

2017-12-14 Thread Willy Tarreau
On Thu, Dec 14, 2017 at 04:39:26PM +0100, Cyril Bonté wrote:
> Adrian Williams reported that several balancing methods were broken and
> sent all requests to one backend. This is a regression in haproxy 1.8 where
> the server score was not correctly recalculated.

Applied, thanks Cyril!

Willy



[PATCH] BUG: MAJOR: lb_map: server map calculation broken

2017-12-14 Thread Cyril Bonté
Adrian Williams reported that several balancing methods were broken and
sent all requests to one backend. This is a regression in haproxy 1.8 where
the server score was not correctly recalculated.

This fix must be backported to the 1.8 branch.
---
 src/lb_map.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lb_map.c b/src/lb_map.c
index ecab4de13..a1e1d3492 100644
--- a/src/lb_map.c
+++ b/src/lb_map.c
@@ -122,7 +122,7 @@ void recalc_server_map(struct proxy *px)
}
}
px->lbprm.map.srv[o] = best;
-   HA_ATOMIC_ADD(&best->wscore, tot);
+   HA_ATOMIC_SUB(&best->wscore, tot);
}
 }
 
-- 
2.11.0