]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
replicator: doveadm replicator replicate -f didn't always start full sync
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 18 Jun 2021 12:19:48 +0000 (15:19 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 29 Nov 2021 06:35:16 +0000 (06:35 +0000)
The full sync happened only if the dsync queue was already full. If it
wasn't, dsync was called too early before user->force_full_sync was set.

src/replication/replicator/replicator-brain.c

index 3c2d9bacf6d00e2fb4d4d35ff7ae88080e9496e8..65cfcecd49c0257e7f757242c262d653ec3661b1 100644 (file)
@@ -36,7 +36,10 @@ static void replicator_brain_queue_changed(void *context)
 {
        struct replicator_brain *brain = context;
 
-       replicator_brain_fill(brain);
+       /* Delay a bit filling the replication. We could have gotten here
+          before the replicator_user change was fully filled out. */
+       timeout_remove(&brain->to);
+       brain->to = timeout_add_short(0, replicator_brain_timeout, brain);
 }
 
 struct replicator_brain *