]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: stick-tables: limit the number of visited nodes during expiration
authorWilly Tarreau <w@1wt.eu>
Wed, 3 Sep 2025 08:45:30 +0000 (10:45 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 3 Sep 2025 13:51:13 +0000 (15:51 +0200)
commit696793205b6f949aba63ebccdd99465ed6cb854c
treede3a36a760cb8696a2f68d7c5115ab7b59eb6d36
parent2421c3769ac832933fb3581f6f6e03048ff4bb14
MINOR: stick-tables: limit the number of visited nodes during expiration

As reported by Felipe in GH issue #3084, on large systems it's not
sufficient to leave the expiration process after a certain number of
expired entries, because if they accumulate too fast, it's possible
to still spend some time visiting many (e.g. those still in use),
which takes time.

Thus here we're taking a stricter approach consisting in counting the
number of visited entries, which allows to leave early if we can't do
the expected work in a reasonable amount of time.

In order to avoid always stopping on first shards and never visiting
last ones, we're always starting from a random shard number and looping
from that one. This way even if we always leave early, all shards will
be handled equally.

This should be backported to 3.2.
src/stick_table.c