]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: peers: No longer ack updates during a full resync master
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 29 Sep 2025 13:49:44 +0000 (15:49 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 7 Nov 2025 10:50:13 +0000 (11:50 +0100)
ACK messages received by a peer sending updates during a full resync are
ignored. So, on the other side, there is no reason to still send these ACK
messages. Let's skip them.

In addition, the received updates during this stage are not considered as to
be acked. It is important to be sure to properly emit ACK messages once the
full sync finished.

src/peers.c

index 941821ed2ed89a34a770d435ac4cf35bd0a83cd0..c894e01732b482e2429cfd66542c16fac1245c48 100644 (file)
@@ -1821,18 +1821,20 @@ int peer_treat_updatemsg(struct appctx *appctx, struct peer *p, int updt, int ex
 
        expire = MS_TO_TICKS(table->expire);
 
-       if (updt) {
-               if (msg_len < sizeof(update)) {
-                       TRACE_ERROR("malformed update message: message too small", PEERS_EV_SESS_IO|PEERS_EV_RX_MSG|PEERS_EV_PROTO_ERR, appctx, p, st);
-                       goto malformed_exit;
-               }
+       if (p->learnstate != PEER_LR_ST_PROCESSING) {
+               if (updt) {
+                       if (msg_len < sizeof(update)) {
+                               TRACE_ERROR("malformed update message: message too small", PEERS_EV_SESS_IO|PEERS_EV_RX_MSG|PEERS_EV_PROTO_ERR, appctx, p, st);
+                               goto malformed_exit;
+                       }
 
-               memcpy(&update, *msg_cur, sizeof(update));
-               *msg_cur += sizeof(update);
-               st->last_get = htonl(update);
-       }
-       else {
-               st->last_get++;
+                       memcpy(&update, *msg_cur, sizeof(update));
+                       *msg_cur += sizeof(update);
+                       st->last_get = htonl(update);
+               }
+               else {
+                       st->last_get++;
+               }
        }
 
        if (exp) {