[Gluster-devel] glusterfs file locking

Vijay Bellur vbellur at redhat.com
Tue Dec 3 17:47:03 UTC 2013

On 12/03/2013 10:02 AM, kane wrote:
> Hi Raghavendra,
> 	What I want to do is to take volume snapshots with btrfs, so I need the volume locked.
> When snapshot is taking, all handles(IO,  gluster cli) except snap hung on.
> As I know, the xlator lock does not lock the whole volume bricks, but only a range of a file in bricks.
> Any good advice?

It does look like you are looking for a mechanism to quiesce/stall all 
updates on the volume. There are a few options that can be considered:

1. Explore the possibility of using features/quiesce translator in to 
block all I/O.

2. Consider re-using the barrier framework being developed for glusterfs 
volume snapshots [1]. Early code is available at [2] and you can follow 
the development there.

3. The glusterfs volume snapshot implementation is currently coupled 
with lvm. One of the goals is to make the snapshotting technology 
pluggable so that we can also leverage btrfs for snapshots. If you are 
interested, we can collaborate to make the implementation more modular.


[1] https://forge.gluster.org/snapshot/pages/Home

[2] http://review.gluster.org/#/q/project:glusterfs-snapshot,n,z

> Thanks,
> Kane
> 在 2013年12月3日,下午12:06,Raghavendra Gowdappa <rgowdapp at redhat.com> 写道:
>> Hi Kane,
>> You don't have to add the xlator explicitly through cli. The xlator is configured by default on bricks when you create a volume.
>> regards,
>> Raghavendra.
>> ----- Original Message -----
>>> From: "kane" <stef_9k at 163.com>
>>> To: rxsingh at gmail.com
>>> Cc: gluster-devel at nongnu.org
>>> Sent: Tuesday, December 3, 2013 8:41:30 AM
>>> Subject: [Gluster-devel] glusterfs file locking
>>> Hi, Rohit:
>>> 	I have googled the issue you mailed last year as below:
>>> ======
>>> Does Gluster provide POSIX compatible file locking transparently with
>>> multiple clients simultaneously trying to lock files on a Gluster share
>>> with the native Gluster client?
>>> A lot of the code in our application framework relies on file locking for
>>> synchronization. I was running across some errors, and wanted to rule out
>>> file locking issues – hence this question.
>>> The gluster documentation mentions a features/posix-locks translator that
>>> should be used for distributed file level locking. This translator can be
>>> added using the config files as shown in the example at
>>> http://gluster.org/community/documentation/index.php/Translators/features/locks.
>>> However, this method of using config files doesn't seem to be available in
>>> newer versions of Gluster, and I couldn't find an equivalent way of using
>>> this translator using the command line.  Can someone confirm if I need to
>>> use this translator, and how I could enable it with Gluster 3.3?
>>> ======
>>> so as I meet this file locking usage in 3.3 too, I want to ask you what did
>>> you
>>> deal with the lock issue at last, did the xlator lock useful?
>>> Thanks,
>>> Kane
>>> _______________________________________________
>>> Gluster-devel mailing list
>>> Gluster-devel at nongnu.org
>>> https://lists.nongnu.org/mailman/listinfo/gluster-devel
> _______________________________________________
> Gluster-devel mailing list
> Gluster-devel at nongnu.org
> https://lists.nongnu.org/mailman/listinfo/gluster-devel

More information about the Gluster-devel mailing list