Forgot to CC: list. ---------- Forwarded message ---------- From: Vikas Gorur <vikas@xxxxxxxxxxxxx> Date: 05-Aug-2007 12:19 Subject: Re: posix-locks problem To: Kevan Benson <kbenson@xxxxxxxxxxxxxxx> On 04/08/07, Kevan Benson <kbenson@xxxxxxxxxxxxxxx> wrote: > I'm having a problem getting locking to work, and this is with TLA patched to 425. > > Whenever I specify posix locks, I see this in the logs: > [xlator.c:154:xlator_set_type] libglusterfs/xlator: dlsym(notify) on /opt/glusterfs-server/lib/glusterfs/1.3.0/xlator/features/posix-locks.so: undefined symbol: notify -- neglecting This is a completely benign warning. > Originally I was trying a semi complex setup with multiple servers and > AFR's and unifies, but in testing I've reduced this to a single server > with a single export and two clients, with no translators at all on the > client side, and I'm still seeing problems. > > Locking works from within the same client, but not from separate > clients. That is, using this simple perl script to perform lock a file > with flock before writing the date, waiting a set period and writing > the date again functions correctly when run twice from one client, > but not when run twice from separate clients. What you're trying to do is use flock(2) locks. flock(2) locks are not supported by FUSE. The lock requests will be handled by the kernel itself and never reach FUSE, let alone GlusterFS. The posix-locks translator implements the fcntl(2) locking API. fcntl(2) allows for more fine-grained locking, as it supports locking of particular regions inside a file --- whereas flock(2) locks are on the entire file. flock(2) and fcntl(2) locks can co-exist on Linux. There is absolutely no interaction between them. In summary, if you want distributed file locks, you should use the fcntl(2) API, not flock(2). Vikas -- http://vikas.80x25.org/