Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
used for tdb_traverse() to tdb_traverse_read().
Jeremy.
(This used to be commit e05ec3047c4fe0cc2e09a812830fc835dc35abea)
|
|
Calling tdb_traverse inside a transaction led to the transaction lock being
held indefinitely. This was caused by the tdb_transaction_lock/unlock inside
tdb_traverse: The transaction code holds the global lock at offset
TRANSACTION_LOCK. The call to tdb_transaction_lock does nothing because the
transaction_lock is already being held. tdb_transaction_unlock inside tdb_wrap
resets tdb->have_transaction_lock but does not release the kernel-level fcntl
lock. transaction_commit later on does not release that fcntl lock either,
because tdb->have_transaction_lock was already reset by tdb_transaction().
This patch does fix that problem for me. An alternative would be to make
tdb->have_transaction_lock a counter that can cope with proper nesting, maybe
in other places as well.
Volker
(This used to be commit 89543005fe2e4934b3c560c937d49304a32a7fc2)
|
|
(This used to be commit 7077df3e2e3f171532f6a5ac87d45201736c9c11)
|
|
(This used to be commit ed0c3a0f74c305b3b8554b05c3f97cf79db8296a)
|
|
(This used to be commit f90a698387c53508862eb6359bd4d1fba1d2b4b0)
|
|
(This used to be commit 40c0919aaa9c1b14bbaebb95ecce53eb0380fdbb)
|
|
(This used to be commit 84b468b2f8f2dffda89593f816e8bc6a8b6d42ac)
|
|
say "locks chain and returned record", not
"and returns record"
Jeremy.
(This used to be commit fa880e6cc16024f14d10cdc8120ce67bfd1d2eb6)
|
|
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.
(This used to be commit fa548ad75e945ae4d167baffb87140c90cba268c)
|
|
this ensures that having the global lock also implies the transaction
lock
(This used to be commit 9dbb2633d7781fcc5d15b175ef36bfda5eb199bb)
|
|
call which does a read lock on all chains. These will be used to make
ldb searches more efficient
(This used to be commit de664ec1f8cf179f1d650563272c0de3f7636e2b)
|
|
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
(This used to be commit af08e56442367b5d803f61b8554d85e2fe0ce7e9)
|
|
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
(This used to be commit 58898092c1ce043f6d698db5065f372b79109e22)
|
|
allow C++
keywords. Change "private" -> "private_data".
Volker
(This used to be commit 047671567173e808fece41485bbeaaeebab7d4a2)
|
|
Jeremy.
(This used to be commit d2e9d5b34baee90060ee9131b3da903309625a56)
|
|
(This used to be commit 1113d4caa7bea1a7ffb9a50f42c5672bc1d452b4)
|
|
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.
(This used to be commit 54203aacd138c30826d54c5d9b6cc8d6e9e270f8)
|
|
don't end up doing a mmap read only
(This used to be commit 294ccfd46a0c4e1af9365d028acdabec03c41ad3)
|
|
tdb_traverse_read() for read only databases
(This used to be commit 9b53e04377d2ff652c4a9496798d2e3aa0dccab3)
|
|
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
(This used to be commit 7dd31288a701d772e45b1960ac4ce4cc1be782ed)
|
|
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.
(This used to be commit 06bd8abba942ec9f1e23f5c5d546cbb71ca3a701)
|
|
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.
(This used to be commit 4673cdd0d261614e707b72a7a348bb0e7dbb2482)
|