Mercurial > dovecot > original-hg > dovecot-1.2
changeset 8805:3feb2afdd81f HEAD
indexes: Make sure we don't shrink log_file_tail_offset.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 05 Mar 2009 17:29:37 -0500 |
parents | 638b27b33401 |
children | 3cebcc8a3f11 |
files | src/lib-index/mail-transaction-log-append.c src/lib-index/mail-transaction-log-file.c |
diffstat | 2 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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 @@ 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));
--- 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 @@ } 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 @@ 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;