dovecot-2.2: lib-index: Fixed checking when we want to update do...

dovecot at dovecot.org dovecot at dovecot.org
Sun Oct 4 18:54:12 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/9e3d7e83a075
changeset: 19283:9e3d7e83a075
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Oct 04 21:51:55 2015 +0300
description:
lib-index: Fixed checking when we want to update dovecot.index
This has been broken since 76f576fc28dc. After that dovecot.index was
usually updated only when dovecot.index.log was being rotated.

diffstat:

 src/lib-index/mail-index-sync.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (19 lines):

diff -r 8322fc090a57 -r 9e3d7e83a075 src/lib-index/mail-index-sync.c
--- a/src/lib-index/mail-index-sync.c	Sun Oct 04 21:49:08 2015 +0300
+++ b/src/lib-index/mail-index-sync.c	Sun Oct 04 21:51:55 2015 +0300
@@ -797,9 +797,12 @@
 {
 	uint32_t log_diff;
 
-	if (index->last_read_log_file_seq != index->map->hdr.log_file_seq) {
-		/* we recently just rotated the log and rewrote index */
-		return FALSE;
+	if (index->last_read_log_file_seq != 0 &&
+	    index->last_read_log_file_seq != index->map->hdr.log_file_seq) {
+		/* dovecot.index points to an old .log file. we were supposed
+		   to rewrite the dovecot.index when rotating the log, so
+		   we shouldn't usually get here. */
+		return TRUE;
 	}
 
 	log_diff = index->map->hdr.log_file_tail_offset -


More information about the dovecot-cvs mailing list