dovecot-2.2: dsync: Removed periodic commits while importing.

dovecot at dovecot.org dovecot at dovecot.org
Thu Oct 3 11:20:27 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/81aedacbb01f
changeset: 16832:81aedacbb01f
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Oct 03 11:20:09 2013 +0300
description:
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.

diffstat:

 src/doveadm/dsync/dsync-mailbox-import.c |  9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

diffs (26 lines):

diff -r a9844ea66c83 -r 81aedacbb01f src/doveadm/dsync/dsync-mailbox-import.c
--- a/src/doveadm/dsync/dsync-mailbox-import.c	Wed Oct 02 11:48:31 2013 +0300
+++ b/src/doveadm/dsync/dsync-mailbox-import.c	Thu Oct 03 11:20:09 2013 +0300
@@ -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 @@
 	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


More information about the dovecot-cvs mailing list