# HG changeset patch # User Timo Sirainen # Date 1524994283 -10800 # Node ID bfeda12bb54a2bca4f53119566dca09418bdc223 # Parent 63b7e595a0fee854e12d2add74970becc42c4295 lib-index: mail_index_sync_map() - Don't try to-resync extension updates This was done to call extension record sync handlers, but the previous commit removes them. Fixes a problem where obsolete cache offsets were used in some situations: - Some cache updates are from external transactions and some are from non-external transactions. This is because cache offset updates are being added by whatever the parent index transaction is. - When mail_index_sync_map() is mapping MAIL_INDEX_SYNC_HANDLER_FILE, it has already synced the map. But it's calling mail_index_sync_record() for non-external transactions to call expunge handlers and extension update handlers. It's calling the regular mail_index_sync_record() to do this work. - But mail_index_sync_record() is actually still updating the map. So now mail_index_sync_record() is called for all non-external cache updates, but not for external cache updates! And since these are somewhat randomly either external or non-external, the end result is that the cache offset may be obsolete. diff -r 63b7e595a0fe -r bfeda12bb54a src/lib-index/mail-index-sync-update.c --- a/src/lib-index/mail-index-sync-update.c Sun Apr 29 12:23:49 2018 +0300 +++ b/src/lib-index/mail-index-sync-update.c Sun Apr 29 12:31:23 2018 +0300 @@ -1029,14 +1029,9 @@ if (LOG_IS_BEFORE(prev_seq, prev_offset, view->map->hdr.log_file_seq, view->map->hdr.log_file_head_offset)) { - /* this has been synced already. we're here only to call - expunge handlers and extension update handlers. */ + /* this has been synced already. */ i_assert(type == MAIL_INDEX_SYNC_HANDLER_FILE); - - if ((thdr->type & MAIL_TRANSACTION_EXTERNAL) != 0) - continue; - if ((thdr->type & MAIL_TRANSACTION_EXT_MASK) == 0) - continue; + continue; } /* we'll just skip over broken entries */