[PATCH] s3: enable mutexes for gencache_notrans.tdb

Michael Adam obnox at samba.org
Fri Jun 6 16:47:15 MDT 2014


On 2014-06-06 at 12:40 -0700, Christof Schmitt wrote:
> On Fri, Jun 06, 2014 at 09:23:35PM +0200, Michael Adam wrote:
> > sn-devel-104 currently does not support robust mutexes, sorry...
> > 
> > The sn-devel-124 based on ubuntu 12.04 that metze is preparing
> > will support them. But having one test host which does support
> > them is a good test as this case proves.
> > 
> > Wouldn't the proper fix be to convert the db to us dbwrap
> > instead of tdb_open_log ?
> 
> I can take a look at that, but doesn't the current dbwrap code try to
> open the database in clustering mode first? Do we need an extra flag for
> dbwrap_open to force a db to be local?

You can either use "ctdb:gencache_notrans.tdb = no" in
smb.conf and use db_open(), (see source3/lib/dbwrap/dbwrap_open.c)
or directly use dbwrap_local_open() (or db_open_tdb()).

Using db_open, you can also control mutexes via
"dbwrap_tdb_mutexes:gencache_notrans.tdb = yes/no".

> > On 2014-06-06 at 11:13 -0700, Jeremy Allison wrote:
> > > Unfortunately this is failing autobuild due to:
> > > 
> > > tdb(/memdisk/jra/a/b943778/samba/bin/ab/client/lockdir/gencache_notrans.tdb): tdb_open_ex: invalid flags for /memdisk/jra/a/b943778/samba/bin/ab/client/lockdir/gencache_notrans.tdb - TDB_MUTEX_LOCKING requires support for robust_mutexes
> > > ../source3/torture/torture.c:8144: gencache_set() failed
> > > 
> > > I think something like the code in source3/lib/dbwrap/dbwrap_open.c
> > > 
> > >                 if (try_mutex && tdb_runtime_check_for_robust_mutexes()) {
> > >                         tdb_flags |= TDB_MUTEX_LOCKING;
> > >                 }
> > > 
> > > should be added here. Give me a bit to look at this..
> 
> Sorry, i assumed that lib/tdb would have a similar check but did not
> verify it.

Right, at the tdb level this is deliberately so.
If you pass TDB_MUTEX_LOCKING to tdb_open, it will fail
the open if the runtime check fails. I.e. if the caller
wants mutexes and tdb_open succees, the callser should
have mutexes. The one dynamic caller-level check we have
is in db_open() and I think it should stay the only one.

Cheers - Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140607/fab5e6f8/attachment.pgp>


More information about the samba-technical mailing list