Bugfix for tdb transactions

tridge at samba.org tridge at samba.org
Sun Jan 31 21:55:06 MST 2010

Hi Volker,

Rusty and I have discussed the kill -9 problem a bit more today, and
we think that we can fix that one properly and the bug you've found
at the same time.

The trick will be to read the recover offset whenever we
go from having zero total locks to one total lock. At that point we
can safely read the recovery magic and check if recovery is needed.

If it is needed then we will grab a write lock over the whole db (from
FREELIST_TOP to EOF), and re-check the recovery magic. If still set we
do a recovery, but don't do the ftruncate().

The cost of this will be 2 mmap deferences per tdb operation. We'll
need to benchmark it, but I think it will be quite cheap. It will be
more expensive if mmap is disabled of course.

Rusty is going to try working up a patch for this.

Cheers, Tridge

More information about the samba-technical mailing list