]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: server/idle: make the next_takeover index per-tgroup
authorWilly Tarreau <w@1wt.eu>
Mon, 21 Nov 2022 13:14:06 +0000 (14:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 21 Nov 2022 18:21:07 +0000 (19:21 +0100)
commitc21a187ec00880bb5f660552e0fa211a247df451
tree25be0b4f715aa03ee920be36691d078d13bafffe
parent9dc231a6b23fc7d5cf3c233b46e00b9e251325b4
MINOR: server/idle: make the next_takeover index per-tgroup

In order to evenly pick idle connections from other threads, there is
a "next_takeover" index in the server, that is incremented each time
a connection is picked from another thread, and indicates which one to
start from next time.

With thread groups this doesn't work well because the index is the same
regardless of the group, and if a group has more threads than another,
there's even a risk to reintroduce an imbalance.

This patch introduces a new per-tgroup storage in servers which, for now,
only contains an instance of this next_takeover index. This way each
thread will now only manipulate the index specific to its own group, and
the takeover will become fair again. More entries may come soon.
include/haproxy/server-t.h
src/backend.c
src/server.c