[Gluster-users] Locking with GlusterFS

Robert Hajime Lanning lanning at lanning.cc
Mon Sep 9 20:01:50 UTC 2013


On 09/09/13 06:57, Olivier Desport wrote:
> Le 09/09/2013 10:50, Xavier Hernandez a écrit :
>> Al 09/09/13 09:59, En/na Olivier Desport ha escrit:
>>> Hello,
>>>
>>> I've created a distribued volume with two bricks. The shares are
>>> partitioned in XFS. Locking doesn't seem to be activated : when I
>>> write in the same file with two different clients, no error occurs.
>>>
>>> What option should I enable on the volume to enable locking ?
>>>
>> Locking is active always, however POSIX (the standard used by
>> GlusterFS) does not impose an exclusive access to files. Under POSIX,
>> it is the responsibility of the application to coordinate concurrent
>> accesses to files using explicit calls to fcntl() to coordinate them.
>> Even using this, another application can read/write the file if it
>> does no use an explicit call to fcntl().
>>
>> Since GlusterFS is POSIX-compliant, it is the expected behavior that
>> two clients could write to the same file at the same time. The
>> resulting file may have a mix of writes from both clients.
>>
>> Best regards,
>>
>> Xavi
>
>
> Thanks for your answer.

BTW, the POSIX locking as described is called "Advisory Locking."

The locking you were originally expecting is called "Mandatory Locking."

-- 
Mr. Flibble
King of the Potato People



More information about the Gluster-users mailing list