]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Change mail_transaction_log_file.need_rotate into a string
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 1 Oct 2019 15:54:31 +0000 (18:54 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Fri, 27 Mar 2020 14:27:53 +0000 (14:27 +0000)
The string specifies the reason why the rotation is wanted.

src/lib-index/mail-transaction-log-file.c
src/lib-index/mail-transaction-log-private.h

index 220659af82274e1d99809cbde7fcaa574629f1b1..bf841a192b653959d2ebdcffd9db1b125daf4e05 100644 (file)
@@ -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));
        }
index c31372395728f059e9e3a71f6e6964c6e9df189d..79e800fda4b7d6c28b99bf00bf463ce0246ee75e 100644 (file)
@@ -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 {