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 )
(cherry picked from commit cc9cce9351c2d64476dbe2f35c43cde8a3f97ebe)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit cd0a30e441faa7d2c6d71f9541d092140f04e6ef)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 228bf0088078ea872fcab61db93a6c306c2d0d0c)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/peers.c b/src/peers.c
index bf7e03d..9b61961 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -2149,6 +2149,8 @@
if ((int)(st->table->localupdate - st->update) < 0)
st->update = st->table->localupdate + (2147483648U);
st->teaching_origin = st->last_pushed = st->update;
+ if ((int)(st->last_pushed - st->table->commitupdate) > 0)
+ st->table->commitupdate = st->last_pushed;
HA_SPIN_UNLOCK(STK_TABLE_LOCK, &st->table->lock);
}
@@ -2199,6 +2201,8 @@
if ((int)(st->table->localupdate - st->update) < 0)
st->update = st->table->localupdate + (2147483648U);
st->teaching_origin = st->last_pushed = st->update;
+ if ((int)(st->last_pushed - st->table->commitupdate) > 0)
+ st->table->commitupdate = st->last_pushed;
HA_SPIN_UNLOCK(STK_TABLE_LOCK, &st->table->lock);
}