]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Improve reason when logging "modseq .. no longer in transaction log"
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 26 Sep 2017 14:23:32 +0000 (16:23 +0200)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Wed, 27 Sep 2017 09:48:18 +0000 (12:48 +0300)
Show the current highest, as well as the last common UID and the current
next UID. These can help to try to figure out problems.

src/doveadm/dsync/dsync-brain-mailbox.c

index f4faa34f87c92e751470b459a0cde0aa7fa5fac2..954a513dbb522c38fc572c1f9dcb62e220d11d81 100644 (file)
@@ -269,22 +269,29 @@ int dsync_brain_sync_mailbox_open(struct dsync_brain *brain,
                brain->failed = TRUE;
                return -1;
        }
+
+       mailbox_get_open_status(brain->box, STATUS_UIDNEXT |
+                               STATUS_HIGHESTMODSEQ |
+                               STATUS_HIGHESTPVTMODSEQ, &status);
        if (ret == 0) {
                if (pvt_too_old) {
                        desync_reason = t_strdup_printf(
-                               "Private modseq %llu no longer in transaction log",
-                               (unsigned long long)last_common_pvt_modseq);
+                               "Private modseq %llu no longer in transaction log "
+                               "(highest=%"PRIu64", last_common_uid=%u, nextuid=%u)",
+                               (unsigned long long)last_common_pvt_modseq,
+                               status.highest_pvt_modseq, last_common_uid,
+                               status.uidnext);
                } else {
                        desync_reason = t_strdup_printf(
-                               "Modseq %llu no longer in transaction log",
-                               (unsigned long long)last_common_modseq);
+                               "Modseq %llu no longer in transaction log "
+                               "(highest=%"PRIu64", last_common_uid=%u, nextuid=%u)",
+                               (unsigned long long)last_common_modseq,
+                               status.highest_modseq, last_common_uid,
+                               status.uidnext);
                }
        }
 
        if (last_common_uid != 0) {
-               mailbox_get_open_status(brain->box, STATUS_UIDNEXT |
-                                       STATUS_HIGHESTMODSEQ |
-                                       STATUS_HIGHESTPVTMODSEQ, &status);
                /* if last_common_* is higher than our current ones it means
                   that the incremental sync state is stale and we need to do
                   a full resync */