1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-15 16:23:49 +03:00
Commit Graph

34 Commits

Author SHA1 Message Date
Andrew Tridgell
7077df3e2e merged changes from v3-2-test 2008-01-18 15:45:22 +11:00
Andrew Tridgell
c54c087a19 merged tdb changes from ctdb 2008-01-18 15:33:57 +11:00
Andrew Tridgell
ed0c3a0f74 merged tdb from ctdb bzr tree 2008-01-15 14:05:47 +11:00
Jeremy Allison
cb6c663fa8 r25892: Keep the tdb code in sync between 3.2.x and 4.0.
Add in the alarm fix to allow locks to exit on
alarm signal.
Sync up the changes in tools.
Jeremy.
2007-12-21 05:44:42 +01:00
Jelmer Vernooij
48d1aa4fcf r24337: Make libreplace provide offsetof. 2007-10-10 15:01:39 -05: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
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
bffb8f8800 r22424: fixed the bad merge (thanks to metze for pointing out) 2007-10-10 14:51:18 -05:00
Andrew Tridgell
a0ff739bca r22422: merged tdb changes from ctdb 2007-10-10 14:51:17 -05:00
Stefan Metzmacher
8f24f6b38e r22319: sync lib/tdb/ with samba3
metze
2007-10-10 14:51:01 -05:00
Volker Lendecke
98a27ab28a r21722: Add the dead record functionality presented on samba-technical@samba.org. If
you do a tdb_set_max_dead(tdb, n), then for this tdb a delete operation will
only mark a record as dead and re-use it if a new record is created. The
parameter n allows for at most n dead records per hash chain. If this number
is exceeded, all dead records are put on the central freelist.

Volker
2007-10-10 14:49:18 -05:00
Volker Lendecke
afe7d78558 r21445: Apply tdb_parse_record Tridges error return, merge to 3_0_25 and 4_0 2007-10-10 14:48:36 -05:00
Volker Lendecke
7b5db2e472 r21303: As discussed on samba-technical: Change the static array for the in-memory
mirrors of the hash chain locks to a dynamically allocated one.

Jeremy, I count on you to revert it if the build farm freaks out, it's after
midnight here :-)

Volker
2007-10-10 14:48: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
Andrew Tridgell
025b142ff2 r18400: move MAP_FAILED define to lib/replace/system/shmem.h 2007-10-10 14:18:23 -05:00
Andrew Tridgell
77d1a468e0 r18129: moved the system includes into libreplace - this gives much more
isolation of our portability environment from the main code, and also
simplifies the includes system (no separate #ifdef _SAMBA_BUILD for
tdb. ldb etc now)
2007-10-10 14:17:36 -05:00
Simo Sorce
941f680453 r17507: pread and pwrite depends on HAVE_PREAD/HAVE_PWRITE not HAVE_PREAD_DECL/HAVE_PWRITE_DECL
and common/io.h already defines pread and pwrite as static if they are not.

remove unneded defines
2007-10-10 14:15:30 -05:00
Andrew Bartlett
5d5503e8d8 r16916: Implement metze's proposed changes to the tdb logging API.
This clearly links the log function with its private pointer, and
makes the argument list for tdb_open_ex a bit shorter.

Andrew Bartlett
2007-10-10 14:09:59 -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
Andrew Tridgell
f325ba605c r14799: added a tdb_get_seqnum() call, and the TDB_SEQNUM flag. This allows
for an extremely lightweight test to see if a tdb has possibly
changed.
2007-10-10 13:59:20 -05:00
Andrew Tridgell
f02a92787b r10524: SAFE_FREE() in tdb does not need the discard_const_p()
the discard_const_p() was causing problems on openbsd where intptr_t is not defined
2007-10-10 13:39:01 -05:00
Andrew Tridgell
a11762e7bc r10495: older redhat boxes need sys/time.h for select() 2007-10-10 13:38:56 -05:00
Andrew Tridgell
144cc3da5e r10493: we need sys/select.h to enable select() in the solaris workaround 2007-10-10 13:38:55 -05:00
Andrew Tridgell
980dd17f7d r10492: work around a bug in solaris which cases lock upgrades to fail with
EDEADLK even when progress can be made. This is not a good solution,
but I can't find anything better.
2007-10-10 13:38:55 -05:00
Andrew Tridgell
196995ea38 r10484: try to fix the pread/pwrite declaration problems 2007-10-10 13:38:53 -05:00
Andrew Tridgell
ab953c8c72 r10471: stratos doesn't have getpagesize(), so guess 8k on systems that don't
have it. Overestimating is harmless.
2007-10-10 13:38:51 -05:00
Andrew Tridgell
e615f36733 r10466: work around missing pread/pwrite declaration on openbsd 2007-10-10 13:38:49 -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
03942dd54b r10459: fixed some portability problems 2007-10-10 13:38:48 -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