]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: stick-tables: compute the shard of string keys on the stored key master
authorOlivier Houchard <ohouchard@haproxy.com>
Mon, 16 Nov 2026 16:27:00 +0000 (17:27 +0100)
committerOlivier Houchard <cognet@ci0.org>
Mon, 16 Nov 2026 16:13:04 +0000 (17:13 +0100)
commit7e7b0d2a3486fb9bd2e46a3a3c05f642b02d5436
tree0f73c5a3d23553a0a5a3412400447bf15dbd795c
parent15d860b81a785dc47c916c38647e772ad22c1c81
BUG/MEDIUM: stick-tables: compute the shard of string keys on the stored key

stksess_setkey_shard() hashes string keys on the raw sample length, while
the stored key is truncated to the table's "len" and stops at the first
NUL. Peers send and hash the stored key, so for longer keys the creating
node and its peers disagree on the shard, and entries are pushed to the
wrong peers.

Let's compute the shard on the stored key length. This was introduced in
2.7 by commit 36d156564 ("MINOR: peers: Support for peer shards") and
should be backported to all stable versions.
src/stick_table.c