diff --git a/src/lib-storage/index/index-transaction.c b/src/lib-storage/index/index-transaction.c index f5a46c9e6e..85c94a92f7 100644 --- a/src/lib-storage/index/index-transaction.c +++ b/src/lib-storage/index/index-transaction.c @@ -56,8 +56,6 @@ index_transaction_index_commit(struct mail_index_transaction *index_trans, } else if (t->box->v.transaction_save_commit_pre(t->save_ctx) < 0) { t->save_ctx = NULL; ret = -1; - } else { - t->changes->changed = TRUE; } } @@ -73,9 +71,8 @@ index_transaction_index_commit(struct mail_index_transaction *index_trans, if (t->super.commit(index_trans, result_r) < 0) { mailbox_set_index_error(t->box); ret = -1; - } else if (result_r->commit_size > 0) { - /* something was written to the transaction log */ - t->changes->changed = TRUE; + } else { + t->changes->changes_mask = result_r->changes_mask; } } diff --git a/src/lib-storage/list/mailbox-list-index-status.c b/src/lib-storage/list/mailbox-list-index-status.c index ee7f468509..1a6655b1dd 100644 --- a/src/lib-storage/list/mailbox-list-index-status.c +++ b/src/lib-storage/list/mailbox-list-index-status.c @@ -792,7 +792,8 @@ index_list_transaction_commit(struct mailbox_transaction_context *t, return -1; t = NULL; - if (!changes_r->changed) + /* check all changes here, because e.g. vsize update is _OTHERS */ + if (changes_r->changes_mask == 0) return 0; /* this transaction commit may have been done in error handling path diff --git a/src/lib-storage/mail-storage.h b/src/lib-storage/mail-storage.h index e9d78ad0e8..f863993717 100644 --- a/src/lib-storage/mail-storage.h +++ b/src/lib-storage/mail-storage.h @@ -343,8 +343,8 @@ struct mail_transaction_commit_changes { /* number of modseq changes that couldn't be changed as requested */ unsigned int ignored_modseq_changes; - /* TRUE if anything actually changed with this commit */ - bool changed; + /* Changes that occurred within this transaction */ + enum mail_index_transaction_change changes_mask; /* User doesn't have read ACL for the mailbox, so don't show the uid_validity / saved_uids. */ bool no_read_perm; diff --git a/src/plugins/replication/replication-plugin.c b/src/plugins/replication/replication-plugin.c index d6f059c15f..461cfeeda3 100644 --- a/src/plugins/replication/replication-plugin.c +++ b/src/plugins/replication/replication-plugin.c @@ -262,7 +262,7 @@ replication_mail_transaction_commit(void *txn, enum replication_priority priority; if (ruser != NULL && !ctx->sync_trans && - (ctx->new_messages || changes->changed)) { + (ctx->new_messages || changes->changes_mask != 0)) { priority = !ctx->new_messages ? REPLICATION_PRIORITY_LOW : ruser->sync_secs == 0 ? REPLICATION_PRIORITY_HIGH : REPLICATION_PRIORITY_SYNC;