WIP/MEDIUM: peers: Forbid <shards> value greater than 65535

This commit is contained in:
Christopher Faulet 2025-10-14 18:46:33 +02:00
parent f12900afd4
commit f974c20b02
2 changed files with 5 additions and 5 deletions

View File

@ -30002,11 +30002,11 @@ server <peername> [/<path>] [param*]
server haproxy3 10.2.0.1:1024 server haproxy3 10.2.0.1:1024
shards <shards> shards <shards>
In some configurations, one would like to distribute the stick-table contents In some configurations, one would like to distribute the stick-table contents
to some peers in place of sending all the stick-table contents to each peer to some peers in place of sending all the stick-table contents to each peer
declared in the "peers" section. In such cases, "shards" specifies the declared in the "peers" section. In such cases, "shards" specifies the number
number of peer involved in this stick-table contents distribution. of peer involved in this stick-table contents distribution. It must be an
integer value between 1 and 65535.
See also "shard" server parameter. See also "shard" server parameter.
table <tablename> type {ip | integer | string [len <length>] | binary [len <length>]} table <tablename> type {ip | integer | string [len <length>] | binary [len <length>]}

View File

@ -1010,8 +1010,8 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm)
goto out; goto out;
} }
if (!curpeers->nb_shards) { if (!curpeers->nb_shards || curpeers->nb_shards > 65535) {
ha_alert("parsing [%s:%d] : '%s' : expects a strictly positive integer argument\n", ha_alert("parsing [%s:%d] : '%s' : expects a integer argument between 1 and 65535\n",
file, linenum, args[0]); file, linenum, args[0]);
err_code |= ERR_FATAL; err_code |= ERR_FATAL;
goto out; goto out;