The result is that "doveadm index" no longer changes caching decisions.
/* find the first message we need to index */
mailbox_get_open_status(box, STATUS_MESSAGES, &status);
- trans = mailbox_transaction_begin(box, 0);
+ trans = mailbox_transaction_begin(box, MAILBOX_TRANSACTION_FLAG_NO_CACHE_DEC);
mail = mail_alloc(trans, 0, NULL);
for (seq = status.messages; seq > 0; seq--) {
mail_set_seq(mail, seq);
t->cache_view = mail_cache_view_open(box->cache, t->view);
t->cache_trans = mail_cache_get_transaction(t->cache_view, t->itrans);
+ if ((flags & MAILBOX_TRANSACTION_FLAG_NO_CACHE_DEC) != 0)
+ mail_cache_view_update_cache_decisions(t->cache_view, FALSE);
+
/* set up after mail_cache_get_transaction(), so that we'll still
have the cache_trans available in _index_commit() */
t->super = t->itrans->v;
is done only if it can be done easily. */
MAILBOX_TRANSACTION_FLAG_ASSIGN_UIDS = 0x04,
/* Refresh the index so lookups return latest flags/modseqs */
- MAILBOX_TRANSACTION_FLAG_REFRESH = 0x08
+ MAILBOX_TRANSACTION_FLAG_REFRESH = 0x08,
+ /* Don't update caching decisions no matter what we do in this
+ transaction (useful for e.g. precaching) */
+ MAILBOX_TRANSACTION_FLAG_NO_CACHE_DEC = 0x10
};
enum mailbox_sync_flags {