ab70f55bb8d824ca1ed7c74196f2f502edd29cc7 |
|
07-Oct-2014 |
Timo Sirainen <tss@iki.fi> |
lib-index: mail_cache_lock() partial rewrite.
require_same_reset_id is no longer needed, if it ever was. If we're locking
the cache file, we always want the latest one. The logic of locking in
general was somewhat confusing and it probably didn't always successfully
lock when it should have, because the reset_id happened to match an old
file. |
2219015cc814b18a72d8d37696a5bffc52edd767 |
|
07-Oct-2014 |
Timo Sirainen <tss@iki.fi> |
lib-index: Don't keep cache file locked for as long while syncing index.
The earlier code was required for updating the cache offsets, but this code
no longer exists. Now we just need to update the record counts in the
header, which can be done quickly at the end of the sync. |
f0ff961282e618945dfe997dc45ff95d656e5790 |
|
03-Nov-2012 |
Timo Sirainen <tss@iki.fi> |
lib-index: Replaced cache's deleted_space with deleted_record_count.
This way when expunging messages we don't need to actually read through the
cache file and calculate how many bytes will be freed, we can simply
increase the deleted_record_count by 1. We'll still compress the cache file
approximately after 20% of the space (records) has been deleted.
This also converts the old "hole offset" header field to tracking the number
of records in the cache file. Otherwise we'd have to assume that all of the
messages in mailbox have a cache record, but that isn't true for users who
have only temporary cache fields. This "hole offset" cannot be trusted
completely, because nothing prevents old Dovecot version from simply writing
a hole offset there and messing up the record counts. Because of this there
are a couple of extra sanity checks for it. (Unfortunately there wasn't any
easy way to simply add a new field to header without breaking backwards
compatibility.) |
131b073bdc3650083b00616dc778dd3017c2bbb5 |
|
03-Nov-2012 |
Timo Sirainen <tss@iki.fi> |
lib-index: Cache record linking is now while writing new records, not later with pwrite().
This should make performance somewhat better. It also means that now the
only overwrites to cache file are to the file header and the fields header.
This means that we no longer have to invalidate file_cache (with
mmap_disable=yes) except when reading the headers, which is always done
anyway.
It would be nice to move the overwritten fields in the headers to a cache
header in dovecot.index file, but this is a bit tricky currently. When
writing these headers the cache file needs to be locked to avoid race
conditions. To avoid deadlocks the transaction log would have to be locked
before the cache. The code to do all this would still be a bit complex, and
to keep backwards compatibility with old Dovecot versions it would still
have to do the overwriting until the backwards compatibility code is
disabled. |