dovecot: If we didn't read tail offset update from transaction l...
dovecot at dovecot.org
dovecot at dovecot.org
Tue Dec 4 12:39:55 EET 2007
details: http://hg.dovecot.org/dovecot/rev/c46a191a8726
changeset: 6924:c46a191a8726
user: Timo Sirainen <tss at iki.fi>
date: Tue Dec 04 12:34:43 2007 +0200
description:
If we didn't read tail offset update from transaction log, we set it to 0 in
index header, causing a lot of unnecessary work.
diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
src/lib-index/mail-index-sync-update.c | 6 +++++-
diffs (16 lines):
diff -r efd6dfbddf19 -r c46a191a8726 src/lib-index/mail-index-sync-update.c
--- a/src/lib-index/mail-index-sync-update.c Tue Dec 04 11:22:36 2007 +0200
+++ b/src/lib-index/mail-index-sync-update.c Tue Dec 04 12:34:43 2007 +0200
@@ -803,7 +803,11 @@ int mail_index_sync_map(struct mail_inde
besides using header updates, it also updates the offset to skip
over following external transactions to avoid extra unneeded log
reading. */
- map->hdr.log_file_tail_offset = index->log->head->max_tail_offset;
+ i_assert(map->hdr.log_file_seq == index->log->head->hdr.file_seq);
+ if (map->hdr.log_file_tail_offset < index->log->head->max_tail_offset) {
+ map->hdr.log_file_tail_offset =
+ index->log->head->max_tail_offset;
+ }
buffer_write(map->hdr_copy_buf, 0, &map->hdr, sizeof(map->hdr));
if (!MAIL_INDEX_MAP_IS_IN_MEMORY(map)) {
More information about the dovecot-cvs
mailing list