Skip to content

Commit cc9cce9

Browse files
EmericBrwtarreau
authored andcommitted
BUG/MEDIUM: peers: reset commitupdate value in new conns
The commitupdate value of the table is used to check if the update is still pending for a push for all peers. To be sure to not miss a push we reset it just after a handshake success. This patch should be backported on all supported branches ( >= 1.6 )
1 parent d9729da commit cc9cce9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/peers.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2409,6 +2409,8 @@ static inline void init_accepted_peer(struct peer *peer, struct peers *peers)
24092409
if ((int)(st->table->localupdate - st->update) < 0)
24102410
st->update = st->table->localupdate + (2147483648U);
24112411
st->teaching_origin = st->last_pushed = st->update;
2412+
if ((int)(st->last_pushed - st->table->commitupdate) > 0)
2413+
st->table->commitupdate = st->last_pushed;
24122414
HA_SPIN_UNLOCK(STK_TABLE_LOCK, &st->table->lock);
24132415
}
24142416

@@ -2459,6 +2461,8 @@ static inline void init_connected_peer(struct peer *peer, struct peers *peers)
24592461
if ((int)(st->table->localupdate - st->update) < 0)
24602462
st->update = st->table->localupdate + (2147483648U);
24612463
st->teaching_origin = st->last_pushed = st->update;
2464+
if ((int)(st->last_pushed - st->table->commitupdate) > 0)
2465+
st->table->commitupdate = st->last_pushed;
24622466
HA_SPIN_UNLOCK(STK_TABLE_LOCK, &st->table->lock);
24632467
}
24642468

0 commit comments

Comments
 (0)