dovecot-1.2: indexes: Make sure we don't shrink log_file_tail_of...

dovecot at dovecot.org dovecot at dovecot.org
Fri Mar 6 00:29:42 EET 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/3feb2afdd81f
changeset: 8805:3feb2afdd81f
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Mar 05 17:29:37 2009 -0500
description:
indexes: Make sure we don't shrink log_file_tail_offset.

diffstat:

2 files changed, 7 insertions(+), 1 deletion(-)
src/lib-index/mail-transaction-log-append.c |    1 +
src/lib-index/mail-transaction-log-file.c   |    7 ++++++-

diffs (35 lines):

diff -r 638b27b33401 -r 3feb2afdd81f src/lib-index/mail-transaction-log-append.c
--- a/src/lib-index/mail-transaction-log-append.c	Thu Mar 05 13:15:17 2009 -0500
+++ b/src/lib-index/mail-transaction-log-append.c	Thu Mar 05 17:29:37 2009 -0500
@@ -537,6 +537,7 @@ static void log_append_sync_offset_if_ne
 
 	if (ctx->file->saved_tail_offset == offset)
 		return;
+	i_assert(offset > ctx->file->saved_tail_offset);
 
 	buf = buffer_create_static_hard(pool_datastack_create(),
 					sizeof(*u) + sizeof(offset));
diff -r 638b27b33401 -r 3feb2afdd81f src/lib-index/mail-transaction-log-file.c
--- a/src/lib-index/mail-transaction-log-file.c	Thu Mar 05 13:15:17 2009 -0500
+++ b/src/lib-index/mail-transaction-log-file.c	Thu Mar 05 17:29:37 2009 -0500
@@ -147,6 +147,8 @@ mail_transaction_log_file_skip_to_head(s
 	}
 	file->saved_tail_offset = log->index->map->hdr.log_file_tail_offset;
 	file->saved_tail_sync_offset = file->saved_tail_offset;
+	if (file->saved_tail_offset > file->max_tail_offset)
+		file->max_tail_offset = file->saved_tail_offset;
 }
 
 static void
@@ -775,7 +777,10 @@ log_file_track_mailbox_sync_offset_hdr(s
 				return 1;
 			}
 			mail_transaction_log_file_set_corrupted(file,
-				"log_file_tail_offset shrank");
+				"log_file_tail_offset update shrank it "
+				"(%u vs %"PRIuUOFF_T", file_seq=%u)",
+				sync_offset, file->saved_tail_offset,
+				file->hdr.file_seq);
 			return -1;
 		}
 		file->saved_tail_offset = sync_offset;


More information about the dovecot-cvs mailing list