From ec7a6682eaebaac2190a23b417631d214264ba13 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 1 Oct 2019 18:54:31 +0300 Subject: [PATCH] lib-index: Change mail_transaction_log_file.need_rotate into a string The string specifies the reason why the rotation is wanted. --- src/lib-index/mail-transaction-log-file.c | 6 +++++- src/lib-index/mail-transaction-log-private.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib-index/mail-transaction-log-file.c b/src/lib-index/mail-transaction-log-file.c index 220659af82..bf841a192b 100644 --- a/src/lib-index/mail-transaction-log-file.c +++ b/src/lib-index/mail-transaction-log-file.c @@ -127,6 +127,7 @@ void mail_transaction_log_file_free(struct mail_transaction_log_file **_file) } i_free(file->filepath); + i_free(file->need_rotate); i_free(file); errno = old_errno; @@ -1351,7 +1352,10 @@ int mail_transaction_log_file_get_modseq_next_offset( i_assert(ret != 0); /* get it fixed on the next sync */ file->log->index->need_recreate = TRUE; - file->need_rotate = TRUE; + if (file->need_rotate == NULL) { + file->need_rotate = + i_strdup("modseq tracking is corrupted"); + } /* clear cache, since it's unreliable */ memset(file->modseq_cache, 0, sizeof(file->modseq_cache)); } diff --git a/src/lib-index/mail-transaction-log-private.h b/src/lib-index/mail-transaction-log-private.h index c313723957..79e800fda4 100644 --- a/src/lib-index/mail-transaction-log-private.h +++ b/src/lib-index/mail-transaction-log-private.h @@ -37,6 +37,7 @@ struct mail_transaction_log_file { uoff_t last_size; time_t last_mmap_error_time; + char *need_rotate; struct mail_transaction_log_header hdr; buffer_t mmap_buffer; @@ -71,7 +72,6 @@ struct mail_transaction_log_file { bool locked:1; bool locked_sync_offset_updated:1; bool corrupted:1; - bool need_rotate:1; }; struct mail_transaction_log { -- 2.47.3