mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-11 00:02:43 +02:00
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.