Locking database cleanup?

tridge at samba.org tridge at samba.org
Sat Apr 8 03:17:02 GMT 2006


 > Just need to clarify that due to licensing reasons, sleepcat db
 > will never replace tdb.  Feel free to patch up Samba to use bdb
 > but realize that it will probably have to be maintained outside
 > of tree.

Just to head off any possible arguments about this, I should point out
that switching to sleepycat wouldn't actually win us anything that we
need, and that we don't already have in tdb (at least once we backport
transactions from tdb in Samba4).

Also, the API differences means that changing from tdb to sleepycat
would be considerably more difficult than changing from the Samba3 tdb
to the Samba4 tdb.

I don't really know enough about the licensing issues with sleepycat
to comment on those, but I didn't want to leave the impression that
licensing is the sole (or even main) reason for staying with tdb.

There are real technical advantages to tdb as well. In particular:

 - everything is always in one file, even with transactions. This
   makes it easier to control permissions. So if an admin does a chmod
   to allow access to someone, then they don't have to worry about
   temporary files.

 - tdb does completely automated crash recovery in its transactions. I
   remember how painful it was to deal with the manual crash recovery
   of sleepycat databases when we used sleepycat with svn.

 - tdb also supports a completely in-memory model with the same API,
   which we take advantage of in some places

 - I suspect the new tdb_get_seqnum() call with prove quite useful in
   future for the rather specialised way we use databases in
   Samba. We're only using it for change notify now in Samba4, but I
   think it is very applicable to a number of other uses in Samba for
   very efficient detection of db changes.

Cheers, Tridge


More information about the samba-technical mailing list