Skip to content

Commit

Permalink
lib-index: Don't update log_file_tail_offset on sync if reading dovec…
Browse files Browse the repository at this point in the history
…ot.index.log failed

This is more of a theoretical issue, since dovecot.index.log read failure is
very unlikely.
  • Loading branch information
sirainen committed Jun 15, 2023
1 parent 830a7db commit aae93d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib-index/mail-index-sync-update.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,8 @@ int mail_index_sync_map(struct mail_index_map **_map,
over following external transactions to avoid extra unneeded log
reading. */
i_assert(map->hdr.log_file_seq == index->log->head->hdr.file_seq);
if (map->hdr.log_file_tail_offset < index->log->head->max_tail_offset) {
if (ret == 0 &&
map->hdr.log_file_tail_offset < index->log->head->max_tail_offset) {
map->hdr.log_file_tail_offset =
index->log->head->max_tail_offset;
}
Expand Down

0 comments on commit aae93d3

Please sign in to comment.