file->sync_highest_modseq = modseq_hdr->highest_modseq;
}
file->saved_tail_offset = log->index->map->hdr.log_file_tail_offset;
+ file->saved_tail_sync_offset = file->saved_tail_offset;
}
static void
sizeof(sync_offset));
if (sync_offset < file->saved_tail_offset) {
+ if (file->sync_offset < file->saved_tail_sync_offset) {
+ /* saved_tail_offset was already set in header,
+ but we still had to resync the file to find
+ modseqs. ignore this record. */
+ return 1;
+ }
mail_transaction_log_file_set_corrupted(file,
"log_file_tail_offset shrank");
return -1;
max_tail_offset automatically by making it skip external transactions
after the last saved offset (to avoid re-reading them unneededly). */
uoff_t saved_tail_offset, max_tail_offset;
+ /* don't give warnings about saved_tail_offset shrinking if
+ sync_offset is less than this. */
+ uoff_t saved_tail_sync_offset;
struct modseq_cache modseq_cache[LOG_FILE_MODSEQ_CACHE_SIZE];