From: Timo Sirainen Date: Tue, 26 Sep 2017 14:23:32 +0000 (+0200) Subject: dsync: Improve reason when logging "modseq .. no longer in transaction log" X-Git-Tag: 2.3.0.rc1~957 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=328ac493fb40b35a6e1d618bd87ffa0e02f4764f;p=thirdparty%2Fdovecot%2Fcore.git dsync: Improve reason when logging "modseq .. no longer in transaction log" 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. --- diff --git a/src/doveadm/dsync/dsync-brain-mailbox.c b/src/doveadm/dsync/dsync-brain-mailbox.c index f4faa34f87..954a513dbb 100644 --- a/src/doveadm/dsync/dsync-brain-mailbox.c +++ b/src/doveadm/dsync/dsync-brain-mailbox.c @@ -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 */