]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: stick-tables: always respect the to_batch limit when trashing
authorWilly Tarreau <w@1wt.eu>
Fri, 12 Apr 2024 08:02:26 +0000 (10:02 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 Apr 2024 15:58:54 +0000 (17:58 +0200)
commit90efe8a87798e37d771c199d92f2ac8b350b24ce
tree528aad65c7a7360653a19dee1b420a423026ec1c
parent44a8f9e7fc4abcadbb72b1ac2cb41f7c788dae55
CLEANUP: stick-tables: always respect the to_batch limit when trashing

When adding the shards support to tables with commit 1a088da7c ("MAJOR:
stktable: split the keys across multiple shards to reduce contention"),
the condition to stop eliminating entries based on the batch size being
reached is based on a pre-decrement of the max_search counter, but now
it goes back into the outer loop which doesn't check it, so next time
it does it when entering the next shard, it will become even more
negative and will properly stop, but at first glance it looks like an
int overflow (which it is not). Let's make sure the outer loop stops
on this condition so that we don't continue searching when the limit
is reached.
src/stick_table.c