From 5973d496b16721af6d2c1fa90b016aacddf13554 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 3 Oct 2013 11:20:09 +0300 Subject: [PATCH] dsync: Removed periodic commits while importing. The problem is that the current algorithm doesn't handle it correctly. If there already are some mails that exist locally, or remote has duplicate mails, the messages may not be saved in the UID order, and if there's a commit between such wrong ordering, the UIDs get renumbered. --- src/doveadm/dsync/dsync-mailbox-import.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/doveadm/dsync/dsync-mailbox-import.c b/src/doveadm/dsync/dsync-mailbox-import.c index 4084b48bae..06c1fe7e24 100644 --- a/src/doveadm/dsync/dsync-mailbox-import.c +++ b/src/doveadm/dsync/dsync-mailbox-import.c @@ -15,8 +15,6 @@ #include "dsync-mailbox.h" #include "dsync-mailbox-import.h" -#define DSYNC_COMMIT_MSGS_INTERVAL 100 - struct importer_mail { const char *guid; uint32_t uid; @@ -1553,13 +1551,6 @@ dsync_mailbox_import_saved_uid(struct dsync_mailbox_importer *importer, if (importer->highest_wanted_uid < uid) importer->highest_wanted_uid = uid; array_append(&importer->wanted_uids, &uid, 1); - - /* commit the transaction once in a while, so if we fail we don't - rollback everything. */ - if (array_count(&importer->wanted_uids) % DSYNC_COMMIT_MSGS_INTERVAL == 0) { - if (dsync_mailbox_import_commit(importer, FALSE) < 0) - importer->failed = TRUE; - } } static bool -- 2.47.3