]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: peers: always update the stksess shard number on incoming updates
authorWilly Tarreau <w@1wt.eu>
Tue, 29 Nov 2022 17:01:28 +0000 (18:01 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 29 Nov 2022 17:06:42 +0000 (18:06 +0100)
If shards are in use, we must fill the shard number on incoming updates,
otherwise some entries are assigned shard number zero, and may be broadcast
everywhere once updated, instead of being sent only to the peers having the
same shard number.

This fixes commit 36d156564 ("MINOR: peers: Support for peer shards"). No
backport is needed.

src/peers.c

index 5245bb71558e131af7639c9a8f2d5073e5ab85af..aa0ab9734e9314838da7def7315305ea0e5b9ad3 100644 (file)
@@ -1808,6 +1808,8 @@ static int peer_treat_updatemsg(struct appctx *appctx, struct peer *p, int updt,
                *msg_cur += keylen;
        }
 
+       newts->shard = stktable_get_key_shard(st->table, newts->key.key, keylen);
+
        /* lookup for existing entry */
        ts = stktable_set_entry(st->table, newts);
        if (ts != newts) {