]> git.kaiwu.me - haproxy.git/commit
MINOR: peers: handle multiple resync requests using shards
authorEmeric Brun <ebrun@haproxy.com>
Mon, 24 Oct 2022 08:04:59 +0000 (10:04 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 24 Oct 2022 08:55:53 +0000 (10:55 +0200)
commitac556082e7771d61cad0907ad6b14d056b282671
treebe423406dae7ede6705ec6b9bca5df009b5326a7
parent36d1565640acf6f8e05f3c67f66d289360009466
MINOR: peers: handle multiple resync requests using shards

We considered the resync process is finished if a full resync request
is ended receiving the "resync-finish" message. But in the case of
"shards" each node declared with a "shard" has only a partial view
of the table. And the resync process is ended whereas the original
peer tables content contains only a "shard" of the full content.

This patch allow to retrieve the entire tables requesting a resync
from all different "shards".

To do so we don't commit the end of a resync process receiving a
"resync-finish" if the node is part of "shard", we only flag this
peer and all peers using the same shard as "notup2date" as if we
received a "resync-partial" message, and we re-schedule a request
of a resync as it is done receiving a "resync-partial" message.

Doing this the peers flagged "notup2date" won't be addressed for the
next resync request round and the next resync request will be send to
a shard not yet requested.

Receving a "resync-finish" message we also check if all peers using
"shards" are flagged "notup2date". It meens that all peers have been
addressed and we can considered the resync process is now finished.

Note also that the "resync request" scheduler already handle a timeout
and if we are not able to retrieve a full resync after a delay. The
resync process is ended.

This patch should be backported in all versions handling "shard"
on peer lines.
src/peers.c