dovecot: Removed cache prev_offset optimization for now. It coul...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jan 30 18:41:41 EET 2008


details:   http://hg.dovecot.org/dovecot/rev/24266b9a6c55
changeset: 7199:24266b9a6c55
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jan 30 18:06:46 2008 +0200
description:
Removed cache prev_offset optimization for now. It could have caused cache
record loops.

diffstat:

1 file changed, 4 insertions(+), 9 deletions(-)
src/lib-index/mail-cache-transaction.c |   13 ++++---------

diffs (30 lines):

diff -r 7f7e295910a5 -r 24266b9a6c55 src/lib-index/mail-cache-transaction.c
--- a/src/lib-index/mail-cache-transaction.c	Sun Jan 27 20:27:59 2008 +0200
+++ b/src/lib-index/mail-cache-transaction.c	Wed Jan 30 18:06:46 2008 +0200
@@ -673,7 +673,6 @@ mail_cache_transaction_switch_seq(struct
 	struct mail_cache_record *rec, new_rec;
 	void *data;
 	size_t size;
-	uint32_t reset_id;
 
 	if (ctx->prev_seq != 0) {
 		/* fix record size */
@@ -682,14 +681,10 @@ mail_cache_transaction_switch_seq(struct
 		rec->size = size - ctx->prev_pos;
 		i_assert(rec->size > sizeof(*rec));
 
-		/* set prev_offset if possible */
-		rec->prev_offset =
-			mail_cache_lookup_cur_offset(ctx->view->view,
-						     ctx->prev_seq, &reset_id);
-		if (reset_id != ctx->cache->hdr->file_seq)
-			rec->prev_offset = 0;
-		else
-			ctx->cache->hdr_copy.continued_record_count++;
+		/* FIXME: here would be a good place to set prev_offset to
+		   avoid doing it later, but avoid circular prev_offsets
+		   when cache is updated multiple times within the same
+		   transaction */
 
 		array_append(&ctx->cache_data_seq, &ctx->prev_seq, 1);
 		ctx->prev_pos = size;


More information about the dovecot-cvs mailing list