[dovecot/core] 892d85: lib-index: Fix modseq tracking for MAIL_INDEX_MAIL...

GitHub noreply at github.com
Fri Aug 11 14:30:09 EEST 2017


  Branch: refs/heads/master
  Home:   https://github.com/dovecot/core
  Commit: 892d85b7c6c36eb3ae6d0a78e4028a5b88b9f3a5
      https://github.com/dovecot/core/commit/892d85b7c6c36eb3ae6d0a78e4028a5b88b9f3a5
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-08-11 (Fri, 11 Aug 2017)

  Changed paths:
    M src/lib-index/mail-transaction-log-file.c

  Log Message:
  -----------
  lib-index: Fix modseq tracking for MAIL_INDEX_MAIL_FLAG_UPDATE_MODSEQ

This is used to increase modseq for mails when their private flags change.
Use an already existing MAIL_TRANSACTION_FLAG_UPDATE_IS_INTERNAL() that
does this properly.

(This change preserves another bug, which is fixed in the next commit.)


  Commit: ace341ac567376f37ded043c4c0f2c46b9aaecb1
      https://github.com/dovecot/core/commit/ace341ac567376f37ded043c4c0f2c46b9aaecb1
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-08-11 (Fri, 11 Aug 2017)

  Changed paths:
    M src/lib-index/mail-transaction-log-file.c

  Log Message:
  -----------
  lib-index: Fix modseq tracking with multiple flag updates

The earlier code was checking only the first flag record update. If the
first one had only internal flag changes but (some of) the rest didn't,
the modseq wasn't counted correctly. This was probably pretty rare.


  Commit: 0cb5be3dc2c16cc95d60e1af64b0be2151d8c008
      https://github.com/dovecot/core/commit/0cb5be3dc2c16cc95d60e1af64b0be2151d8c008
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-08-11 (Fri, 11 Aug 2017)

  Changed paths:
    M src/lib-index/mail-index-modseq.c

  Log Message:
  -----------
  lib-index: Fix checking if modseq header is up-to-date

We were almost always assuming that it is.


  Commit: eda341e845b1f346d94e89a77d79899dea51ea3b
      https://github.com/dovecot/core/commit/eda341e845b1f346d94e89a77d79899dea51ea3b
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-08-11 (Fri, 11 Aug 2017)

  Changed paths:
    M src/lib-index/mail-index-modseq.c

  Log Message:
  -----------
  lib-index: Update per-flag modseq value a bit more correctly.

This changes the code to be similar to the per-mail modseq updating in
mail_index_modseq_update(). It probably wasn't exactly wrong previously
either, but this change is required for the following commits.


  Commit: 43ab0dbe6b498a414a34c3e1c782f4fa5507b34e
      https://github.com/dovecot/core/commit/43ab0dbe6b498a414a34c3e1c782f4fa5507b34e
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-08-11 (Fri, 11 Aug 2017)

  Changed paths:
    M src/lib-index/mail-index-modseq.c

  Log Message:
  -----------
  lib-index: Fix setting highest_modseq correctly in mail_index_modseq_header

The internally counted ctx->highest_modseq wasn't correct if all of the
records weren't synced. This could have happened for various reasons.
Since the view's current log seq/offset is used for the header, we can
also use the current highest_modseq from the view as well and it's
guaranteed to be correct.

This fixes various potential problems with using QRESYNC and CONDSTORE
extensions. It also fixes potential errors with unhibernating imap
clients, including:

Error: .../dovecot.index.log: Transaction log changed unexpectedly, can't get modseq


  Commit: 2b170a01b7e966c584fc7573034180d75b321d0d
      https://github.com/dovecot/core/commit/2b170a01b7e966c584fc7573034180d75b321d0d
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-08-11 (Fri, 11 Aug 2017)

  Changed paths:
    M src/lib-index/mail-index-modseq.c
    M src/lib-index/mail-index-modseq.h
    M src/lib-index/mail-index-sync-update.c

  Log Message:
  -----------
  lib-index: Remove tracking of mail_index_modseq_sync.highest_modseq

It's no longer necessary after the previous changes.


  Commit: 9f02b2016f05292cfe2635380a95392976c55c6f
      https://github.com/dovecot/core/commit/9f02b2016f05292cfe2635380a95392976c55c6f
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-08-11 (Fri, 11 Aug 2017)

  Changed paths:
    M src/lib-index/Makefile.am
    A src/lib-index/test-mail-transaction-log-file.c

  Log Message:
  -----------
  lib-index: Add unit test to mail_transaction_update_modseq()


  Commit: 2c4d4d0af1b673c25d558e7505603f6a9d62f48b
      https://github.com/dovecot/core/commit/2c4d4d0af1b673c25d558e7505603f6a9d62f48b
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-08-11 (Fri, 11 Aug 2017)

  Changed paths:
    M src/lib-index/test-mail-transaction-log-file.c

  Log Message:
  -----------
  lib-index: Add unit tests to mail_transaction_log_file_get_modseq_next_offset() and _get_highest_modseq_at()


  Commit: 7e78f1cfc10cc0540134b5507e08524a0fdd5c93
      https://github.com/dovecot/core/commit/7e78f1cfc10cc0540134b5507e08524a0fdd5c93
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-08-11 (Fri, 11 Aug 2017)

  Changed paths:
    M src/lib-index/mail-transaction-log-file.c

  Log Message:
  -----------
  lib-index: Code cleanup - move code to get_modseq_next_offset_at()

In preparation for making the next commit smaller.


  Commit: 5e03576913a0030de6f8d22c79e353a968a6a35f
      https://github.com/dovecot/core/commit/5e03576913a0030de6f8d22c79e353a968a6a35f
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2017-08-11 (Fri, 11 Aug 2017)

  Changed paths:
    M src/lib-index/mail-index-sync.c
    M src/lib-index/mail-transaction-log-file.c
    M src/lib-index/mail-transaction-log-private.h
    M src/lib-index/mail-transaction-log.c
    M src/lib-index/test-mail-transaction-log-file.c

  Log Message:
  -----------
  lib-index: Fix wrong mail_index_modseq_header automatically

It happens only on the next sync, although that isn't actually guaranteed to
happen. Still, it happens almost always so this should be good enough.


Compare: https://github.com/dovecot/core/compare/b0ead8fffe8d...5e03576913a0


More information about the dovecot-cvs mailing list