From: Timo Sirainen Date: Wed, 1 Apr 2020 19:11:21 +0000 (+0300) Subject: lib-index: Cache transaction rollback used too small value to increase deleted_record... X-Git-Tag: 2.3.11.2~390 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=887470384538a77ec2cd65ab46a83cc7033c85f8;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Cache transaction rollback used too small value to increase deleted_record_count 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. --- diff --git a/src/lib-index/mail-cache-transaction.c b/src/lib-index/mail-cache-transaction.c index 46916a02f3..4734fb3fd9 100644 --- a/src/lib-index/mail-cache-transaction.c +++ b/src/lib-index/mail-cache-transaction.c @@ -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)