1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-14 12:23:52 +03:00
Commit Graph

19 Commits

Author SHA1 Message Date
Andrew Tridgell
ed0c3a0f74 merged tdb from ctdb bzr tree 2008-01-15 14:05:47 +11:00
Jelmer Vernooij
f90a698387 r24336: Use standard data type uint32_t rather than tdb-specific u32. 2007-10-10 15:01:39 -05:00
Andrew Tridgell
40c0919aaa r23798: updated old Temple Place FSF addresses to new URL 2007-10-10 14:59:15 -05:00
Andrew Tridgell
84b468b2f8 r23795: more v2->v3 conversion 2007-10-10 14:59:14 -05:00
Jeremy Allison
fa880e6cc1 r23371: Fix the misleading comment I added - it really *should*
say "locks chain and returned record", not
"and returns record"
Jeremy.
2007-10-10 14:53:13 -05:00
Jeremy Allison
fa548ad75e r23370: Traverse in tdb wasn't consistently using the
travlocks.lock_rw for lock read/write types, it
was sometimes using it (tdb_next_lock) and
sometimes explicitly using F_WRLCK instead.
Change this to consistently use travlocks.lock_rw
only.
I'm pretty sure about this fix (else I woudn't
be checking this in :-) but tridge and Volker
please review.
Jeremy.
2007-10-10 14:53:12 -05:00
Andrew Tridgell
9dbb2633d7 r23238: merged transaction lock changes from ctdb
this ensures that having the global lock also implies the transaction
lock
2007-10-10 14:53:06 -05:00
Andrew Tridgell
de664ec1f8 r19401: make tdb_lockall() much more efficient, and add a tdb_lockall_read()
call which does a read lock on all chains. These will be used to make
ldb searches more efficient
2007-10-10 14:21:26 -05:00
Stefan Metzmacher
af08e56442 r17532: merge from SAMBA_3_0 Revision: 17460
First step at fixing the build breakage with the groupmapping test. On Linux,
 F_RDLCK is defined to 0, for example NetBSD has it at 1.

 Still does not work fully though. Still investigating.

metze
2007-10-10 14:15:34 -05:00
Andrew Bartlett
58898092c1 r16774: This patch modifies the tdb API to allow the logging function to be used
as part of ldb.

This allows tdb failures to be passed all the way up to Samba's DEBUG
system, which allowed easier debugging.

Unfortunately I had to extend the tdb API, as the logging function
didn't have a context pointer.

I've worked over the 'debug levels' in TDB.  Most of them were 0,
which didn't seem right, as some were trace-like messages.  We didn't
see any of these previously, except when accessing TDB directly.

Andrew Bartlett
2007-10-10 14:09:45 -05:00
Volker Lendecke
0476715671 r15120: Minimize the diff between Samba3 and Samba4 tdb: In Samba3 we don't allow C++
keywords. Change "private" -> "private_data".

Volker
2007-10-10 14:04:10 -05:00
Jeremy Allison
d2e9d5b34b r14029: Fix resource leak in error codepath. Coverity CID #64.
Jeremy.
2007-10-10 13:52:37 -05:00
Simo Sorce
1113d4caa7 r13773: Be consistent in the way you get out and free allocated data 2007-10-10 13:52:11 -05:00
Andrew Tridgell
54203aacd1 r10522: finally got the locking working on solaris10. This adds a read lock on
the transaction lock in tdb_traverse_read(). This prevents a pattern
of locks which triggers the deadlock detection code in solaris10. I
suspect solaris10 is trying to prevent lock starvation by granting
locks in the order they were requested, which makes it much easier to
produce deadlocks.
2007-10-10 13:39:00 -05:00
Andrew Tridgell
294ccfd46a r10465: separate out a read_only db from a read-only traversal to ensure we
don't end up doing a mmap read only
2007-10-10 13:38:49 -05:00
Andrew Tridgell
9b53e04377 r10424: for caller convenience, automatically turn a tdb_traverse() into a
tdb_traverse_read() for read only databases
2007-10-10 13:38:44 -05:00
Andrew Tridgell
7dd31288a7 r10421: following on discussions with simo, I have worked out a way of
allowing searches to proceed while another process is in a
transaction, then only upgrading the transaction lock to a write lock
on commit.

The solution is:

 - split tdb_traverse() into two calls, called tdb_traverse() and
   tdb_traverse_read(). The _read() version only gets read locks, and
   will fail any write operations made in the callback from the
   traverse.

 - the normal tdb_traverse() call allows for read or write operations
   in the callback, but gets the transaction lock, preventing
   transastions from starting inside the traverse

In addition we enforce the following rule that you may not start a
transaction within a traverse callback, although you can start a
traverse within a transaction

With these rules in place I believe all the deadlock possibilities are
removed, and we can now allow for searches to happen in parallel with
transactions
2007-10-10 13:38:44 -05:00
Andrew Tridgell
06bd8abba9 r10405: added transactions into tdb, and hook them into ldb. See my
samba-technical posting for more details on the transactions design.

This also adds a number of command line arguments to tdbtorture,
making it more flexible, and fixes some lock deadlock conditions in
the tdbtorture code.
2007-10-10 13:38:41 -05:00
Andrew Tridgell
4673cdd0d2 r10253: a fairly large tdb cleanup and re-organise. Nearly all of this change
just involves splitting up the core tdb.c code into separate files on
logical boundaries, but there are some minor functional changes as well:

 - move the 'struct tdb_context' into tdb_private.h, hiding it from
   users. This was done to allow the structure to change without
   breaking code that uses tdb.

 - added accessor functions tdb_fd(), tdb_name(), and tdb_log_fn() to
   access the elements of struct tdb_context that were used by
   external code but are no longer visible

 - simplied tdb_append() to use tdb_fetch()/tdb_store(), which is just
   as good due to the way tdb locks work

 - changed some of the types (such as tdb_off to tdb_off_t) to make
   syntax highlighting work better

 - removed the old optional spinlock code. It was a bad idea.

 - fixed a bug in tdb_reopen_all() that caused tdbtorture to sometimes
   fail or report nasty looking errors. This is the only real bug
   fixed in this commit. Jeremy/Jerry, you might like to pickup this
   change for Samba3, as that could definately affect smbd in
   Samba3.

The aim of all of these changes is to make the tdb
transactions/journaling code I am working on easier to write. I
started to write it on top of the existing tdb.c code and it got very
messy. Splitting up the code makes it much easier to follow.

There are more cleanups we could do in tdb, such as using uint32_t
instead of u32 (suggested by metze). I'll leave those for another day.
2007-10-10 13:38:12 -05:00