]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: peers: some updates are pushed twice after a resync.
authorEmeric Brun <ebrun@haproxy.com>
Wed, 10 Aug 2016 15:19:27 +0000 (17:19 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 10 Aug 2016 15:42:13 +0000 (17:42 +0200)
This bug is due to a copy/paste error and was introduced
with peers-protocol v2:

The last_pushed pointer was not correctly reset to the teaching_origin at
the end of the teaching state but to the first update present in the tree.

The result: some updates were re-pushed after leaving the teaching state.

This fix needs to be backported to 1.6.

src/peers.c

index a8066c53ee4395beef854f566cbd420a9712c98e..b3a14e6a7a2c4835c9fd76240f2dd12112fc5950 100644 (file)
@@ -1491,9 +1491,7 @@ incomplete:
                                                                        /* push local updates */
                                                                        if (!eb || eb->key > st->teaching_origin) {
                                                                                st->flags |= SHTABLE_F_TEACH_STAGE2;
-                                                                               eb = eb32_first(&st->table->updates);
-                                                                               if (eb)
-                                                                                       st->last_pushed = eb->key - 1;
+                                                                               st->last_pushed = st->teaching_origin;
                                                                                break;
                                                                        }