http://dovecot.procontrol.fi/test/ I think I've fixed the problems that were corrupting indexes with the new code. It happened every time you had expunged some messages and new messages arrived. I think this release might actually work :) disable_plaintext_auth = yes will be default from now on. It allows plaintext authentication from localhost (127.*, ::1) however. I just figured out that the lockless cache file reading prevents me from fixing the mbox code to work the same way it used to. I'm not sure actually how this would be best fixed.. Problem is that headers in mails change and move the messages around in the mailbox, so I have to keep track of them. Previously I just updated the header size in index files.. but without read locks this can't be done safely. One possibility would be to parse the whole mbox file every time when the mailbox is opened (or when it needs to be read) and save the header sizes in memory. That'd make it slower than it is today though.. Or maybe it'd work if I just grabbed exclusive lock whenever reading header sizes. They could be then copied into memory to avoid locking more than once. But that still creates locking contention if lots of clients are reading the mailbox. Exactly in the situation where I'd mostly use mboxes.. I could also save it in .imap.index file which still currently uses read-locks. But I'd rather want to get rid of them in there too.
On Sunday, Aug 24, 2003, at 11:43 Europe/Helsinki, Timo Sirainen wrote:> I just figured out that the lockless cache file reading prevents me > from fixing the mbox code to work the same way it used to. I'm not > sure actually how this would be best fixed.. Problem is that headers > in mails change and move the messages around in the mailbox, so I have > to keep track of them. Previously I just updated the header size in > index files.. but without read locks this can't be done safely.Stupid stupid stupid. Why did it take this long to figure out. Write: lock(); data[0] = stuff; data[1] = stuff; unlock(); Read: do { copy = data; } while (copy[0] != copy[1]); There's my lockless reading for data that changes. Solves mbox problems, allows easily changing .imap.index to be read-lockless and probably more. Doubles the space requirements, but that's still small.
Timo Sirainen <tss at iki.fi> writes:> Or maybe it'd work if I just grabbed exclusive lock whenever reading > header sizes. They could be then copied into memory to avoid locking > more than once. But that still creates locking contention if lots of > clients are reading the mailbox. Exactly in the situation where I'd > mostly use mboxes..Would not one rather use Maildir and assume the Kernel caches directory data? No locking contention... -- Matthias Andree
On Sunday 24 August 2003 10:43, Timo Sirainen wrote:> messages arrived. I think this release might actually work :)But not on my machine ;( I got those compilation errors: Making all in lib-auth make[3]: Entering directory `/home/jens/dovecot-0.99.11-test6/src/lib-auth' /opt/diet/bin/diet gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../src/lib -L/usr/local/lib -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -c auth-client.c auth-client.c:7: auth-server-connection.h: No such file or directory make[3]: *** [auth-client.o] Error 1 make[3]: Leaving directory `/home/jens/dovecot-0.99.11-test6/src/lib-auth' Using auth-server-connection.h from CVS worked ok, until I got: auth-server-connection.c:11: auth-server-request.h: No such file or directory looks like you've forgotten some files. Anyway, I will test latest CVS on my machines :) Jens