From e64d7b6f388fecd0c83a4f2acb54e30d5ac98c6c Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 17 Jun 2008 04:51:40 +0300 Subject: [PATCH] Make sure initial_modseq is correct when rotating transaction log. --HG-- branch : HEAD --- src/lib-index/mail-transaction-log-file.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lib-index/mail-transaction-log-file.c b/src/lib-index/mail-transaction-log-file.c index 582fd80a4d..039679d2e1 100644 --- a/src/lib-index/mail-transaction-log-file.c +++ b/src/lib-index/mail-transaction-log-file.c @@ -185,9 +185,15 @@ mail_transaction_log_init_hdr(struct mail_transaction_log *log, hdr->file_seq = 1; } - if (log->head != NULL && hdr->file_seq <= log->head->hdr.file_seq) { - /* make sure the sequence grows */ - hdr->file_seq = log->head->hdr.file_seq+1; + if (log->head != NULL) { + if (hdr->file_seq <= log->head->hdr.file_seq) { + /* make sure the sequence grows */ + hdr->file_seq = log->head->hdr.file_seq+1; + } + if (hdr->initial_modseq < log->head->sync_highest_modseq) { + /* this should be always up-to-date */ + hdr->initial_modseq = log->head->sync_highest_modseq; + } } return 0; } -- 2.47.3