]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Cache transaction rollback used too small value to increase deleted_record...
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 1 Apr 2020 19:11:21 +0000 (22:11 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 15 Apr 2020 09:41:42 +0000 (12:41 +0300)
Rollback used records_written to update it, but that was actually counting
the number of transaction flushes, not the number of individual mail cache
records that were written.

src/lib-index/mail-cache-transaction.c

index 46916a02f3ca2857743161d9512861e0b28b56bc..4734fb3fd90f5b8eb9d67211236b69e23a9c6bc2 100644 (file)
@@ -286,6 +286,7 @@ mail_cache_transaction_update_index(struct mail_cache_transaction_ctx *ctx,
 
                write_offset += rec->size;
                rec = CONST_PTR_OFFSET(rec, rec->size);
+               ctx->records_written++;
        }
 }
 
@@ -493,7 +494,6 @@ mail_cache_transaction_flush(struct mail_cache_transaction_ctx *ctx)
                ret = -1;
        else {
                /* update records' cache offsets to index */
-               ctx->records_written++;
                mail_cache_transaction_update_index(ctx, write_offset);
        }
        if (mail_cache_flush_and_unlock(ctx->cache) < 0)