Work on SMB3 persistent handles

Volker Lendecke Volker.Lendecke at SerNet.DE
Fri Oct 27 08:38:55 UTC 2017

On Thu, Oct 26, 2017 at 01:37:21PM -0500, Christopher R. Hertel via samba-technical wrote:
> Several.  Hopefully they're helpful.
> - Below you mention that you removed TDB_CLEAR_IF_FIRST from the open
>   calls to locking.tdb and smbXsrv_open_global.tdb.  I did the same as
>   a test, but I also removed TDB_CLEAR_IF_FIRST from the
>   byte-range-locking and leases databases.  These two additional
>   databases are also used to maintain handle state.
>   Unfortunately, the change resulted in random core dumps related to
>   libtevent.

That's very surprising. Can we follow up here? libtevent should be
completely unrelated to TDB_CLEAR_IF_FIRST, and as long as the tdb is
not corrupted, we should have routines to live well with stale
records. Your crashes might point at issues where we could become
better in surviving corrupt database contents.

> - Regarding the backing store...  All four of the databases we've
>   identified are opened and accessed via the DBwrap API.  DBwrap hides
>   the differences between CTDB and TDB, and also provides for
>   "transactions".  The problem is that DBwrap is somewhat specific to
>   [C]TDB.  We may be able to work around that, though.

No, I don't see dbwrap as specific to [c]tdb. In fact, a very early
prototype that demostrated a clustered version of Samba was
dbwrap_file. This used a file per record, to be stored on a central
clustered file system. It turned out to be surprisingly fast, but
still more expensive than raw tdb. This has in the meantime been
removed, because ctdb turned out to be our way to cluster tdbs. But it
should be a pretty simple excercise to revive this. As I wrote in my
previous mail, as long as you give us fetch_locked, we're 99% there.


SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen, mailto:kontakt at

More information about the samba-technical mailing list