Skip to content

Commit

Permalink
dsync: Removed periodic commits while importing.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sirainen committed Oct 3, 2013
1 parent 5f92936 commit 5973d49
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/doveadm/dsync/dsync-mailbox-import.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5973d49

Please sign in to comment.