summaryrefslogtreecommitdiff
path: root/lib/tdb
AgeCommit message (Collapse)AuthorFilesLines
2009-07-31tdb: don't alter tdb->flags in tdb_reopen_all()Rusty Russell1-6/+13
The flags are user-visible, via tdb_get_flags/add_flags/remove_flags. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-07-31tdb: Reimplementation of Metze's "lib/tdb: if we know pwrite and pread are ↵Rusty Russell1-5/+10
thread/fork safe tdb_reopen_all() should be a noop". This version just wraps the reopen code, so we still re-grab the lock and do the normal sanity checks. The reason we do this at all is to avoid global fd limits, see: http://forums.fedoraforum.org/showthread.php?t=210393 Note also that this whole reopen concept is fundamentally racy: if the parent goes away before the child calls tdb_reopen_all, the database can be left without an active lock and another TDB_CLEAR_IF_FIRST opener will clear it. A fork_with_tdbs() wrapper could use a pipe to solve this, but it's hardly elegant (what if there are other independent things which have similar needs?). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-07-31tdb: Revert "lib/tdb: if we know pwrite and pread are thread/fork safe ↵Rusty Russell1-5/+0
tdb_reopen_all() should be a noop" This reverts commit e17df483fbedb81aededdef5fbb6ae1d034bc2dd. tdb_reopen_all also restores the active lock, required for TDB_CLEAR_IF_FIRST. Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-07-30realloc() has that horrible overloaded free semantic when size is 0:Rusty Russell1-2/+7
current code does a free of the old record in this case, then fail.
2009-07-30If the record is at the end of the database, pretending it has length 1Rusty Russell1-4/+1
might take us out-of-bounds. Only pretend to be length 1 for the malloc.
2009-07-21tdb: fix locking errorRusty Russell1-1/+1
54a51839ea65aa788b18fce8de0ae4f9ba63e4e7 "Make tdb transaction lock recursive (samba version)" was broken: I "cleaned it up" and prevented it from ever unlocking. To see the problem: $ bin/tdbtorture -s 1248142523 tdb_brlock failed (fd=3) at offset 8 rw_type=1 lck_type=14 len=1 tdb_transaction_lock: failed to get transaction lock tdb_transaction_start failed: Resource deadlock avoided My testcase relied on the *count* being correct, which it was. Fixing that now. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Michael Adam <obnox@samba.org>
2009-07-20Make tdb transaction lock recursive (samba version)Rusty Russell3-21/+20
This patch replaces 6ed27edbcd3ba1893636a8072c8d7a621437daf7 and 1a416ff13ca7786f2e8d24c66addf00883e9cb12, which fixed the bug where traversals inside transactions would release the transaction lock early. This solution is more general, and solves the more minor symptom that nested traversals would also release the transaction lock early. (It was also suggestd in Volker's comment in 6ed27ed). This patch also applies to ctdb, if the traverse.c part is removed (ctdb's tdb code never received the previous two fixes). Tested using the testsuite from ccan (adapted to the samba code). Thanks to Michael Adam for feedback. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Michael Adam <obnox@samba.org>
2009-07-03tdb: fix define of tdbdir when srcdir != "."Björn Jacke1-2/+2
2009-07-03Sort the signature filesSimo Sorce2-44/+44
2009-06-17tdb: Fix help string in configure flag to enable Python bindings.Jelmer Vernooij1-1/+1
2009-06-17fix release scripts to always git cleanSimo Sorce1-0/+3
This makes sure we do not include foreign object files or other build byproducts by mistake.
2009-06-15Add exports file and abi checker for tdbSimo Sorce7-3/+172
This is a first attempt at exporting symbols only for public functions We also provide a rudimentary ABI checker that tries to check that function signatures are not changed by mistake. Given our use of macros this is not an API checker. It's all based on tdb.h contents and the gcc -aux-info option
2009-06-15Add option to --disable-python on buildSimo Sorce1-0/+9
2009-06-06lib/tdb/tools/tdbtorture.c: fixed memory leak.Slava Semushin1-0/+2
Found by cppcheck: [lib/tdb/tools/tdbtorture.c:326]: (error) Memory leak: pids
2009-06-01overallocate all records by 25%Andrew Tridgell1-0/+3
This greatly reduces the fragmentation of databases where records tend to grow slowly by a small amount each time. The case where this is most seen is the ldb index records. Adding this overallocation reduced the size of the resulting database by more than 20x when running a test that adds 10k users.
2009-06-01auto-repack in transactions that expand the tdbAndrew Tridgell1-0/+12
The idea behind this is to recover from badly fragmented free lists. Choosing the point where the file expands is fairly arbitrary, but seems to work well.
2009-05-28fixed tdbbackup to give tdb error messagesAndrew Tridgell1-7/+31
2009-05-28Merge branch 'master' of ssh://git.samba.org/data/git/sambaAndrew Tridgell1-6/+6
2009-05-28make TDB_NOSYNC affect all the fsync/msync calls in transactionsAndrew Tridgell1-5/+7
During a transaction commit tdb normally uses fsync/msync calls to make it crash safe. This can be disabled using the TDB_NOSYNC flag, but it wasn't disabling all the code paths that caused a fsync/msync.
2009-05-27tdb: Fix some recently introduced warnings in tdbtoolTim Prouty1-6/+6
2009-05-26added some more speed tests to tdbtoolAndrew Tridgell1-6/+59
This adds 3 simple speed tests to tdbtool, for transaction store, store and fetch. On my laptop this shows transactions costing about 10ms
2009-05-21Detect tight loop in tdb_find()Jim McDonough1-0/+5
2009-05-16Update copies of config.guess and config.sub.Jelmer Vernooij2-76/+282
2009-05-05Update tdb and talloc web pagesSimo Sorce1-4/+10
2009-05-05Add release scripts for talloc and tdbSimo Sorce1-0/+45
2009-03-31tdb: Remove unused variableTim Prouty1-1/+0
2009-03-31up the version to 1.1.4 with the addition ofAndrew Tridgell1-1/+1
tdb_transaction_prepare_commit()
2009-03-31added basic testing of tdb_transaction_prepare_commit() in tdbtortureAndrew Tridgell1-0/+6
2009-03-31Add tdb_transaction_prepare_commit()Howard Chu3-52/+133
Using tdb_transaction_prepare_commit() gives us 2-phase commits. This allows us to safely commit across multiple tdb databases at once, with reasonable transaction semantics Signed-off-by: tridge@samba.org
2009-02-25lib/tdb: if we know pwrite and pread are thread/fork safe tdb_reopen_all() ↵Stefan Metzmacher1-0/+5
should be a noop The reason for tdb_reopen_all() is that the seek pointer on fds are shared between parent and child. metze
2009-02-03lib/tdb: don't generate a static library for the samba4 buildStefan Metzmacher1-1/+1
We also don't do this for talloc and ldb. metze
2009-02-02lib/tdb: the python bindings don't use swig anymoreStefan Metzmacher1-4/+2
metze
2009-01-30s3 build: Remove unused fstat check to fix a bunch of HAVE_FSTAT warningsTim Prouty1-4/+0
2009-01-30lib/tdb: include replace.h and system/filesys.h in pytdb.cStefan Metzmacher1-4/+3
This fixes the build on Tru64. metze
2009-01-08Avoid using a utility header for Python replacements included in Samba,Jelmer Vernooij1-1/+5
since this will not be shipped with talloc/tdb/tevent/etc.
2009-01-07s3/s4 build: Fix Py_RETURN_NONE to work with python versions < 2.4Tim Prouty1-1/+1
2009-01-06py: Properly increase the reference counter of Py_None.Jelmer Vernooij1-16/+16
2008-12-31Fix all warnings in source3 with gcc4.3.Jeremy Allison1-1/+3
Jeremy.
2008-12-23standalone: Use more variables, preparing to include these files from mainJelmer Vernooij1-5/+6
Samba 4 makefile.
2008-12-22Fix standalone build of tdb python module, update ignores for standalone tdb.Jelmer Vernooij1-4/+4
2008-12-18Make sure to not close tdb database more than once.Jelmer Vernooij1-2/+10
2008-12-18Remove swig use from tdb standalone build.Jelmer Vernooij3-14/+5
2008-12-18Implement missing functions in pytdb.Jelmer Vernooij2-34/+66
2008-12-18Add simple manually written replacement for the tdb module.Jelmer Vernooij6-4990/+453
2008-12-16s3/s4: Fix "shadows a global declaration" warningTim Prouty1-1/+1
2008-12-16Added a simple tdb integrity check to tdbtool. The command "check" runs ↵Holger Hetterich1-1/+28
traverse on the currently open tdb, and returns the number of entries if the integrity check is successful.
2008-12-16imported the tdb_repack() code from CTDBAndrew Tridgell2-1/+93
The tdb_repack() function repacks a TDB so that it has a single freelist entry. The file doesn't shrink, but it does remove all freelist fragmentation. This code originated in the CTDB vacuuming code, but will now be used in ldb to cope with fragmentation from re-indexing
2008-12-16make tdbbackup use transactionsAndrew Tridgell1-6/+19
tdbbackup was originally written before we had transactions, and it attempted to use its own fsync() calls to make it safe. Now that we have transactions we can do it in a much safer (and faster!) fashion
2008-09-29lib/tdb: increase the version number after some critial changesStefan Metzmacher1-1/+1
The tdb_transaction/traverse interaction fixes are critical. metze
2008-09-19Add shared-build target to tdb.Simo Sorce4-0/+30
Useful to build multiple standalone libraries that depend on each other without having to install them to the final install dir during the build.