2.3.1 Replication is throwing scary errors

Thore Bödecker
Wed, 13 Jun 2018 11:29:53 -0000

Hey all,

almost 48h ago I upgraded both my instances to 2.3.1 again to see if
the new patches would fix the replication issues for me.

So far, the result is: great.

I haven't been able to provoke any kind of I/O stall or persisting
queued/failed resync requests in my replication setup.

Newly added users are replicated instantly upon the first received
mails and the home directory gets created without issues now too.

For reference: I'm using the official 2.3.1 tarball together with the
3 attached patches, that have been taken from GitHub diffs/commits
linked to me by Aki in the #dovecot channel.

I can only encourage everyone to try out 2.3.1 again with these 3
patches to make sure it is rock-solid so that we might get a proper
and stable 2.3.2 release soon-ish :)


PS: For the Arch Linux users among you the dovecot-2.3.1-5 package in
the official repo contains said three patches :)


Cheers,
Thore

--
Thore B?decker

GPG ID: 0xD622431AF8DB80F3
GPG FP: 0F96 559D 3556 24FC 2226  A864 D622 431A F8DB 80F3
-------------- next part --------------
commit 890883f12e8d8dd3309743eb95cf0b04f6e39ea0
Author: Aki Tuomi <aki.tuomi at dovecot.fi>
Date:   Mon Mar 19 18:39:27 2018 +0200

    dsync: Revert to /tmp if home does not exist

    Fixes doveadm: Error: Couldn't lock .dovecot-sync.lock:
safe_mkstemp(.dovecot-sync.lock) failed: No such file or directory

diff --git a/src/doveadm/dsync/dsync-brain.c b/src/doveadm/dsync/dsync-brain.c
index c2b8169..1e84182 100644
--- a/src/doveadm/dsync/dsync-brain.c
+++ b/src/doveadm/dsync/dsync-brain.c
@@ -401,6 +401,7 @@ dsync_brain_lock(struct dsync_brain *brain, const char
*remote_hostname)
                .lock_method = FILE_LOCK_METHOD_FCNTL,
        };
        const char *home, *error, *local_hostname = my_hostdomain();
+       struct stat st;
        bool created;
        int ret;

@@ -437,8 +438,21 @@ dsync_brain_lock(struct dsync_brain *brain, const char
*remote_hostname)

        if (brain->verbose_proctitle)
                process_title_set(dsync_brain_get_proctitle_full(brain,
DSYNC_BRAIN_TITLE_LOCKING));
-       brain->lock_path = p_strconcat(brain->pool, home,
-                                      "/"DSYNC_LOCK_FILENAME, NULL);
+
+       /* if homedir does not yet exist, create lock under tmpdir */
+       if (stat(home, &st) < 0) {
+               if (errno != ENOENT) {
+                       i_error("stat(%s) failed: %m", home);
+                       return -1;
+               }
+               brain->lock_path = p_strdup_printf(brain->pool,
"%s/%s-%s",
+
brain->user->set->mail_temp_dir,
+                                                  brain->user->username,
+
"/"DSYNC_LOCK_FILENAME);
+       } else {
+               brain->lock_path = p_strconcat(brain->pool, home,
+                                              "/"DSYNC_LOCK_FILENAME,
NULL);
+       }
        brain->lock_fd = file_create_locked(brain->lock_path,
&lock_set,
                                            &brain->lock, &created,
&error);
        if (brain->lock_fd == -1)
-------------- next part --------------