]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: peers: Support for peer shards
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 17 Oct 2022 12:58:19 +0000 (14:58 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 24 Oct 2022 08:55:53 +0000 (10:55 +0200)
commit36d1565640acf6f8e05f3c67f66d289360009466
tree317b91f870f12a7675f0cbb1f790350fc1c3da1f
parent7941ead3aa00c9e83fadf70a1d6d515d20421ad0
MINOR: peers: Support for peer shards

Add "shards" new keyword for "peers" section to configure the number
of peer shards attached to such secions. This impact all the stick-tables
attached to the section.
Add "shard" new "server" parameter to configure the peers which participate to
all the stick-tables contents distribution. Each peer receive the stick-tables updates
only for keys with this shard value as distribution hash. The "shard" value
is stored in ->shard new server struct member.
cfg_parse_peers() which is the function which is called to parse all
the lines of a "peers" section is modified to parse the "shards" parameter
stored in ->nb_shards new peers struct member.
Add srv_parse_shard() new callback into server.c to pare the "shard"
parameter.
Implement stksess_getkey_hash() to compute the distribution hash for a
stick-table key as the 64-bits xxhash of the key concatenated to the stick-table
name. This function is called by stksess_setkey_shard(), itself
called by the already implemented function which create a new stick-table
key (stksess_new()).
Add ->idlen new stktable struct member to store the stick-table name length
to not have to compute it each time a stick-table key hash is computed.
doc/configuration.txt
include/haproxy/peers-t.h
include/haproxy/server-t.h
include/haproxy/stick_table-t.h
src/cfgparse.c
src/peers.c
src/server.c
src/stick_table.c