I've been having some file locking issues with running Dovecot IMAP storage on a triple-replicated Gluster Volume. The volume is mounted with the
glusterfs type using defaults. This implies a FUSE mount. The OS is Fedora 28, kernel 4.18.18-200.fc28.x86_64.
<host>:/volume /mount glusterfs defaults,x-systemd.automount,noauto 0 0
File lock errors appear in the logs on the
dovecot.index* files when moving a large amount of mail in my e-mail client (Thunderbird). Researching the issue I found some Dovecot documentation regarding shared filesystems.
The suggestions made about the
lock_method setting seem clear to me. I have specific question regarding the Memory Mapping section:
By default Dovecot mmap()s the index files. This may not work with all clustered filesystems, and it most certainly won't work with NFS. Setting mmap_disable = yes disables mmap() and Dovecot does its own internal caching. If mmap() is supported by your filesystem, it's still not certain that it gives better performance. Try benchmarking to make sure.
Am I affected by this? Does FUSE+GlustFS support
mmap() in a proper way?
When poking around on the internet trying to find the answer I found the following havoc:
- Some issues with a python dev on SO trying to use
mmap()in shared mode.
- A closed PR at Numpy. trying to fix the
But these are both python related and I'm not sure how Dovecot implements
mmap(). I also found a patch over at lwm.net:
From: Tejun Heo <email@example.com> To: Miklos Szeredi <firstname.lastname@example.org>, lkml <email@example.com>, firstname.lastname@example.org Subject: [PATCH] FUSE/CUSE: implement direct mmap support Date: Tue, 09 Feb 2010 15:08:36 +0900 Cc: Lars Wendler <email@example.com>, Andrew Morton <firstname.lastname@example.org> Implement FUSE direct mmap support. The server can redirect client mmap requests to any SHMLBA aligned offset in the custom address space attached to the fuse channel. The address space is managed by the server using mmap/munmap(2). The SHMLBA alignment requirement is necessary to avoid cache aliasing issues on archs with virtually indexed caches as FUSE direct mmaps are basically shared memory between clients and the server
But this addressed FUSE as a whole and doesn't really answer my question with certainty.