MEDIUM: log/balance: leverage lbprm api for log load-balancing
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 28 Mar 2024 14:42:37 +0000 (15:42 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Fri, 29 Mar 2024 16:08:37 +0000 (17:08 +0100)
commit3c6dfa618a57fe71082b1681d1b9fb443b8af04a
treebc536670aa1db690dba6414b2f922c5ef388987b
parent9aea6df81ffcb6d0ee64dda7c2876deb2698c77f
MEDIUM: log/balance: leverage lbprm api for log load-balancing

log load-balancing implementation was not seamlessly integrated within
lbprm API. The consequence is that it could become harder to maintain
over time since it added some specific cases just for the log backend.
Moreover, it resulted in some code duplication since balance algorithms
that are common to logs and regular (tcp, http) backends were specifically
rewritten for log backends.

Thanks to the previous commit, we now have all the prerequisites to make
log load-balancing fully leverage lbprm logic. Thus in this patch we make
__do_send_log_backend() use existing lbprm algorithms, and we no longer
require log-specific lbprm initialization in cfgparse.c and in
postcheck_log_backend().

As a bonus, for log backends this allows weighed algorithms to properly
support weights (ie: roundrobin, random and log-hash) since we now
leverage the same lb algorithms that we use for tcp/http backends
(doc was updated).
doc/configuration.txt
include/haproxy/backend-t.h
src/cfgparse.c
src/log.c
src/proxy.c