Rev 111: this is a demonstration of an idea for handling locks in
ctdb. in http://samba.org/~tridge/ctdb
tridge at samba.org
tridge at samba.org
Mon Apr 16 06:01:37 GMT 2007
------------------------------------------------------------
revno: 111
revision-id: tridge at samba.org-20070416060137-6d90f720fec05ba5
parent: tridge at samba.org-20070416041310-3f6200073a57aeff
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Mon 2007-04-16 16:01:37 +1000
message:
this is a demonstration of an idea for handling locks in ctdb.
The problem we have is this:
- we want the client smbd processes to be able to 'shortcut' access
to the ltdb, by directly accessing the ltdb, and if the header of
the record shows we are the dmaster then process immediately, with
no overhead of talking across the unix domain socket
- a client doing a shortcut will use tdb_chainlock() to lock the
record while processing
- we want the main ctdb daemon to be able to set locks on the
record, and when those locks collide with a 'shortcut' fcntl lock,
we want the ctdb daemon to keep processing other operations
- we don't want to have to send a message from a smbd client to the
ctdbd each time it releases a lock
The solution is shown in this example. Note that the expensive fork()
and blocking lock is only paid in case of contention, so in the median
case I think this is zero cost.
added:
tests/lockwait.c lockwait.c-20070416055753-3ztnb4cxqgamfudx-1
modified:
Makefile.in makefile.in-20061117234101-o3qt14umlg9en8z0-1
common/util.c util.c-20061117234101-o3qt14umlg9en8z0-20
config.mk config.mk-20070416041303-xql6zaaq90w8kovl-1
include/includes.h includes.h-20061117234101-o3qt14umlg9en8z0-17
Diff too large for email (315, the limit is 200).
More information about the samba-cvs
mailing list