]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: peers: some table updates are randomly not pushed.
authorEmeric Brun <ebrun@haproxy.com>
Tue, 22 Sep 2015 13:05:06 +0000 (15:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 22 Sep 2015 14:07:27 +0000 (16:07 +0200)
If an entry is still not present in the update tree, we could miss to schedule
for a push depending of an un-initialized value (upd.key remains un-initialized
for new sessions or isn't re-initalized for reused ones).

In the same way, if an entry is present in the tree, but its update's tick
is far in the past (> 2^31). We could consider it's still scheduled even if
it is not the case.

The fix consist to force the re-scheduling of an update if it was not present in
the updates tree or if the update is not in the scheduling window of every peers.

src/stick_table.c

index a51bde3be5126ec49001951a44ffd3b7f1a24a18..c3b76ad61835ce308ea4a08b9b8b800c5de741bd 100644 (file)
@@ -255,9 +255,11 @@ struct stksess *stktable_touch(struct stktable *t, struct stksess *ts, int local
 
        /* If sync is enabled and update is local */
        if (t->sync_task && local) {
-               /* If this entry was already pushed to a peer
-                  We want to push it again */
-               if ((int)(ts->upd.key - t->commitupdate) <= 0) {
+               /* If this entry is not in the tree
+                  or not scheduled for at least one peer */
+               if (!ts->upd.node.leaf_p
+                   || (int)(t->commitupdate - ts->upd.key) >= 0
+                   || (int)(ts->upd.key - t->localupdate) >= 0) {
                        ts->upd.key = ++t->update;
                        t->localupdate = t->update;
                        eb32_delete(&ts->upd);