]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: peers: stop considering ack messages teaching a full resync
authorEmeric Brun <ebrun@haproxy.com>
Thu, 4 Mar 2021 09:27:10 +0000 (10:27 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 28 Apr 2021 12:23:10 +0000 (14:23 +0200)
The re-con cursor was updated receiving any ack message
even if we are pushing a complete resync to a peer. This cursor
is reset at the end of the resync but if the connection is broken
during resync, we could re-start at an unwanted point.

With this patch, the peer stops to consider ack messages pushing
a resync since the resync process has is own acknowlegement and
is always restarted from the beginning in case of broken connection.

This patch should be backported on all supported branches ( >= 1.6 )

src/peers.c

index cff5696b826e5d3497182953106b39b81fa7bb35..69c228796c9ca9ed862a2a73936297dfcb4ad993 100644 (file)
@@ -1813,6 +1813,10 @@ static inline int peer_treat_ackmsg(struct appctx *appctx, struct peer *p,
        uint32_t update;
        struct shared_table *st;
 
+       /* ignore ack during teaching process */
+       if (p->flags & PEER_F_TEACH_PROCESS)
+               return 1;
+
        table_id = intdecode(msg_cur, msg_end);
        if (!*msg_cur || (*msg_cur + sizeof(update) > msg_end)) {
                /* malformed message */