On 19.6.2004, at 20:50, Moe Wibble wrote:
Actually it is a syncing problem, but not like the others. It happens when Dovecot tries to update maildir (flags, expunges) but finds out that some file is missing, so it tries to sync the maildir to find it. Except it is already in the middle of syncing index, so it crashes. Have to think a while what is the right fix for this.
Sounds confusing. Shouldn't the index-sync just be delayed if there's one in progress already? I imagine something like while ( log->index->log_locked ) usleep(500);. After all it's locked, isn't it?
But it's then syncing the index itself, so sleeping wouldn't help :) It basically goes like:
- begin index sync
- commit each change to maildir
- maildir files may change their names, so if it's lost, we have to
find it again:
- read everything in maildir and store them
- begin index sync, so we can store the changes in it
- oops, we're already syncing index, crash
- maildir files may change their names, so if it's lost, we have to
find it again:
- finish index sync
Anyway, the fix was pretty simple. Just update the maildir filenames and leave the index syncing later.
I'll release test19 sometimes later after some more mbox fixes.