[Gluster-devel] mandatory lock

Anand Avati avati at gluster.org
Thu Jan 8 20:21:18 UTC 2015


Ideally you want the clients to coordinate among themselves. Note that this
feature cannot be implemented foolproof (theoretically) in a system that
supports NFSv3.

On Thu Jan 08 2015 at 8:57:48 AM Harmeet Kalsi <kharmeet at hotmail.com> wrote:

> Hi Anand, that was spot on. Any idea if there will be development on this
> side in near future as multiple clients writing to the same file can cause
> issues.
>
> Regards
>
> ------------------------------
> From: avati at gluster.org
> Date: Thu, 8 Jan 2015 16:07:50 +0000
>
> Subject: Re: [Gluster-devel] mandatory lock
> To: rgowdapp at redhat.com; kharmeet at hotmail.com
> CC: gluster-devel at gluster.org
>
>
> Note that the mandatory locks available in the locks translator is just
> the mandatory extensions for posix locks - at least one of the apps must be
> using locks to begin with. What Harmeet is asking for is something
> different - automatic exclusive access to edit files. i.e, if one app has
> opened a file for editing, other apps which attempt an open must either
> fail (EBUSY) or block till the first app closes. We need to treat
> open(O_RDONLY) as a read lock and open(O_RDWR|O_WRONLY) as a write lock
> request (essentially an auto applied oplock). This is something gluster
> does not yet have.
>
> Thanks
>
> On Thu Jan 08 2015 at 2:49:29 AM Raghavendra Gowdappa <rgowdapp at redhat.com>
> wrote:
>
>
>
> ----- Original Message -----
> > From: "Raghavendra Gowdappa" <rgowdapp at redhat.com>
> > To: "Harmeet Kalsi" <kharmeet at hotmail.com>
> > Cc: "Gluster-devel at gluster.org" <gluster-devel at gluster.org>
> > Sent: Thursday, January 8, 2015 4:12:44 PM
> > Subject: Re: [Gluster-devel] mandatory lock
> >
> >
> >
> > ----- Original Message -----
> > > From: "Harmeet Kalsi" <kharmeet at hotmail.com>
> > > To: "Gluster-devel at gluster.org" <gluster-devel at gluster.org>
> > > Sent: Wednesday, January 7, 2015 5:55:43 PM
> > > Subject: [Gluster-devel] mandatory lock
> > >
> > > Dear All.
> > > Would it be possible for someone to guide me in the right direction to
> > > enable
> > > the mandatory lock on a volume please.
> > > At the moment two clients can edit the same file at the same time
> which is
> > > causing issues.
> >
> > I see code related to mandatory locking in posix-locks xlator (pl_writev,
> > pl_truncate etc). To enable it you've to set "option mandatory-locks
> yes" in
> > posix-locks xlator loaded on bricks
> > (/var/lib/glusterd/vols/<volname>/*.vol). We've no way to set this
> option
> > through gluster cli. Also, I am not sure to what extent this feature is
> > tested/used till now. You can try it out and please let us know whether
> it
> > worked for you :).
>
> If mandatory locking doesn't work for you, can you modify your application
> to use advisory locking, since advisory locking is tested well and being
> used for long time?
>
> >
> > > Many thanks in advance
> > > Kind Regards
> > >
> > > _______________________________________________
> > > Gluster-devel mailing list
> > > Gluster-devel at gluster.org
> > > http://www.gluster.org/mailman/listinfo/gluster-devel
> > >
> > _______________________________________________
> > Gluster-devel mailing list
> > Gluster-devel at gluster.org
> > http://www.gluster.org/mailman/listinfo/gluster-devel
> >
> _______________________________________________
> Gluster-devel mailing list
> Gluster-devel at gluster.org
> http://www.gluster.org/mailman/listinfo/gluster-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gluster.org/pipermail/gluster-devel/attachments/20150108/b010f4b1/attachment-0001.html>


More information about the Gluster-devel mailing list