[Dovecot] testing needed: log file concurrency

Timo Sirainen tss at iki.fi
Wed Jun 20 02:41:42 EEST 2007


http://dovecot.org/tmp/concurrency.c

I'd want to know what results this program gives with different systems.
Please test and reply (but don't bother if someone already replied with
the same OS+result). I expect it to print:

 - SMP kernels: "page size cut" once in a while
 - UP (uniprocessor) kernels: Nothing
 - The most important thing is that it never prints "broken data"

It might take a while for it to print anything. With my computer it
takes anything from a few seconds to a minute or so. See the file itself
for compiling/running instructions.

So far I've tested only with Linux 2.6.21 x86-64/SMP and a slow
Solaris/Sparc/UP.

If you're interested in knowing what this is about:

Dovecot writes to dovecot.index.log files by first writing the
transaction with its size being 0. After that it writes the 4 size bytes
again (using a bit special format with all bytes ORed with 0x80).

I expected that when another process is read()ing the file and it
notices the size being valid (all bytes having 0x80) that the whole
transaction could always be read. But looks like if the size happens to
be just before a memory page boundary, it's possible that the updated
size is read, but the rest of the transaction isn't.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20070620/4b9cc4b4/attachment.bin 


More information about the dovecot mailing list