BUG/MINOR: peers: always update the stksess shard number on incoming updates

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.
This commit is contained in:
Willy Tarreau 2022-11-29 18:01:28 +01:00
parent b12be7c1bb
commit 4ede46be4e
1 changed files with 2 additions and 0 deletions

View 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) {