]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: backend: add new "balance hash <expr>" algorithm
authorWilly Tarreau <w@1wt.eu>
Mon, 25 Apr 2022 08:25:34 +0000 (10:25 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 Apr 2022 14:09:26 +0000 (16:09 +0200)
commit7c9a0fe2a68116d15a3014587277a4ad891dc429
treed0e3513a9a5f9a4071d98815cb1fd426d74dd8be
parentb9f30f398b58ddda4f552eca465f18eb3cecfc40
MEDIUM: backend: add new "balance hash <expr>" algorithm

Almost all of our hash-based LB algorithms are implemented as special
cases of something that can now be achieved using sample expressions,
and some of them have adopted some options to adapt their behavior in
ways that could also be achieved using converters.

There are users who want to hash other parameters that are combined
into variables, and who set headers from these values and use
"balance hdr(name)" for this.

Instead of constantly implementing specific options and having users
hack around when they want a real hash, let's implement a native hash
mode that applies to a standard sample expression. This way, any
fetchable element (including variables) may be used to construct the
hash, even modified by any converter if desired.
doc/configuration.txt
include/haproxy/backend-t.h
src/backend.c
src/cfgparse.c
src/proxy.c
src/sample.c