[PATCH] lib/tdb: new locking hook.
rusty at rustcorp.com.au
Thu Aug 27 23:03:05 MDT 2009
On Fri, 28 Aug 2009 01:30:42 pm tridge at samba.org wrote:
> Hi Rusty,
> > This obsoletes the *mark and *nonblock calls, by allowing the user
> > to do fancy work replacing, recording or faking fcntl locks. This
> > should make ctdb's life easier.
> that is OK, but I'd like to see this integrated and tested in ctdb
> first, as ctdb is the one that uses the mark locks.
> Ronnie, have you looked at this?
Yes, I was going to port all these patches through to ctdb, then use it...
but it's much cleaner if patches only go one way, so I reconsidered.
> > We could avoid adding YA open function if we didn't want to allow
> > non-blocking open, or complete tracking of all lock operations.
> I don't think the new open is needed just yet, unless you have a use
> in mind for it. The way ctdb uses the 'mark' locks is not at open
> time, but when the tdb is already attached and ctdb wants a child
> process to handle the locking.
Yep, I've looked at what ctdb does. This patch aims for a superset of what
ctdb needs: eg. we could do non-blocking transaction locks and other fancy
But hold off on this patch, once the others are in my life is simpler. I
can make sure it plays well with ctdb (ie. *mark and *nonblock can be
implemented externally, and I'll do that and test it).
I'm excited about the idea of a proxy locking object: if it can't get the
lock non-blocking, it records all the locks and fails. Then you get a child
to grab those locks, once it's done the proxy locking object "succeeds" on
those lock requests the next time.
More information about the samba-technical