dovecot-1.2: Don't give bogus "log_file_tail_offset shrank" errors.

dovecot at dovecot.org dovecot at dovecot.org
Sun Aug 31 11:50:37 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.2/rev/285f636884dc
changeset: 8136:285f636884dc
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Aug 31 11:50:27 2008 +0300
description:
Don't give bogus "log_file_tail_offset shrank" errors.

diffstat:

2 files changed, 10 insertions(+)
src/lib-index/mail-transaction-log-file.c    |    7 +++++++
src/lib-index/mail-transaction-log-private.h |    3 +++

diffs (37 lines):

diff -r 0be9c476acdd -r 285f636884dc src/lib-index/mail-transaction-log-file.c
--- a/src/lib-index/mail-transaction-log-file.c	Sun Aug 31 11:49:47 2008 +0300
+++ b/src/lib-index/mail-transaction-log-file.c	Sun Aug 31 11:50:27 2008 +0300
@@ -146,6 +146,7 @@ mail_transaction_log_file_skip_to_head(s
 		file->sync_highest_modseq = modseq_hdr->highest_modseq;
 	}
 	file->saved_tail_offset = log->index->map->hdr.log_file_tail_offset;
+	file->saved_tail_sync_offset = file->saved_tail_offset;
 }
 
 static void
@@ -767,6 +768,12 @@ log_file_track_mailbox_sync_offset_hdr(s
 		       sizeof(sync_offset));
 
 		if (sync_offset < file->saved_tail_offset) {
+			if (file->sync_offset < file->saved_tail_sync_offset) {
+				/* saved_tail_offset was already set in header,
+				   but we still had to resync the file to find
+				   modseqs. ignore this record. */
+				return 1;
+			}
 			mail_transaction_log_file_set_corrupted(file,
 				"log_file_tail_offset shrank");
 			return -1;
diff -r 0be9c476acdd -r 285f636884dc src/lib-index/mail-transaction-log-private.h
--- a/src/lib-index/mail-transaction-log-private.h	Sun Aug 31 11:49:47 2008 +0300
+++ b/src/lib-index/mail-transaction-log-private.h	Sun Aug 31 11:50:27 2008 +0300
@@ -59,6 +59,9 @@ struct mail_transaction_log_file {
 	   max_tail_offset automatically by making it skip external transactions
 	   after the last saved offset (to avoid re-reading them unneededly). */
 	uoff_t saved_tail_offset, max_tail_offset;
+	/* don't give warnings about saved_tail_offset shrinking if
+	   sync_offset is less than this. */
+	uoff_t saved_tail_sync_offset;
 
 	struct modseq_cache modseq_cache[LOG_FILE_MODSEQ_CACHE_SIZE];
 


More information about the dovecot-cvs mailing list