From: Timo Sirainen Date: Fri, 20 Mar 2009 22:21:25 +0000 (-0400) Subject: Mailbox syncing: If syncing wrote to transaction log, update the tail offset to inclu... X-Git-Tag: 2.0.alpha1~1038^2~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6741035592d65975dedc47426253b9bcab294506;p=thirdparty%2Fdovecot%2Fcore.git Mailbox syncing: If syncing wrote to transaction log, update the tail offset to include them. --HG-- branch : HEAD --- diff --git a/src/lib-index/mail-index-sync.c b/src/lib-index/mail-index-sync.c index ab36b94583..1df834add0 100644 --- a/src/lib-index/mail-index-sync.c +++ b/src/lib-index/mail-index-sync.c @@ -706,8 +706,15 @@ mail_index_sync_update_mailbox_offset(struct mail_index_sync_ctx *ctx) uint32_t seq; uoff_t offset; - mail_transaction_log_view_get_prev_pos(ctx->view->log_view, - &seq, &offset); + if (!mail_transaction_log_view_is_last(ctx->view->log_view)) { + /* didn't sync everything */ + mail_transaction_log_view_get_prev_pos(ctx->view->log_view, + &seq, &offset); + } else { + /* synced everything, but we might also have committed new + transactions. include them also here. */ + mail_transaction_log_get_head(ctx->index->log, &seq, &offset); + } mail_transaction_log_set_mailbox_sync_pos(ctx->index->log, seq, offset); /* If tail offset has changed, make sure it gets written to