]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: peers: Don't wait for a remote resync if there no remote peer
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 25 Apr 2024 19:47:01 +0000 (21:47 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 25 Apr 2024 19:47:02 +0000 (21:47 +0200)
commit4b1a7ea66c7499d44eec9cc061e848e44bd73dd0
tree0cb7bc36998a645243b24de112acdd37f3e88593
parent0243691de17137f0c89a86d396a89900aa70122b
BUG/MINOR: peers: Don't wait for a remote resync if there no remote peer

When a resync is needed, a local resync is first tried and if it does not
work, a remote resync is tried. It happens when the worker is started for
instance. There is a timeout to wait for the local resync, except for the
first start. And if the local resync fails or times out, the same timeout
is applied to the remote resync. This one is always applied, even if there
is no remote peer.

On the other hand, on reload, if the old worker has never performed its
resync, it does not try to resync the new worker. And here there is an
issue. On the first reload, when there is no remote peer, we must wait for
the resync timeout expiration to have a chance to resync the new worker. If
the reload happens too early, there is no resync at all. Concretly, after a
fresh start, if a reload happens in the first 5 seconds, there is no resync
with the new worker. The issue only concerns the first reload and affects
the second worker.

To fix the issue, we must only skip the remote resync if there is no remote
peer. This way, on a fresh start, the worker is immediately considered as
resync. The local reynsc is skipped because it is the first worker and the
remote resync is skipped because there is no remote peer.

This patch must be backported to all stable versions.
src/peers.c