summaryrefslogtreecommitdiffstats
path: root/lib/tdb
Commit message (Collapse)AuthorAgeFilesLines
* tdb: use fdatasync() instead of fsync() in transactionsAndrew Tridgell2010-02-131-1/+1
| | | | This might help on some filesystems
* tdb: Apply some const, just for clarityVolker Lendecke2010-02-131-1/+1
|
* tdb: fix recovery reuse after crashRusty Russell2010-02-101-4/+10
| | | | | | | | | | | | | | | If a process (or the machine) dies after just after writing the recovery head (pointing at the end of file), the recovery record will filled with 0x42. This will not invoke a recovery on open, since rec.magic != TDB_RECOVERY_MAGIC. Unfortunately, the first transaction commit will happily reuse that area: tdb_recovery_allocate() doesn't check the magic. The recovery record has length 0x42424242, and it writes that back into the now-valid-looking transaction header) for the next comer (which happens to be tdb_wipe_all in my tests). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb: give a name to the invalid recovery area constant (0)Rusty Russell2010-02-103-4/+5
| | | | Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* release-scripts: parametrize scriptsSimo Sorce2010-02-082-48/+67
| | | | | | | This should make it easier to keep all release scripts alined as it will reduce the difference between them to ideally a few variables Also moves the tdb script in the scripts directory.
* tdb: raise version to 1.2.1Simo Sorce2010-02-061-1/+1
| | | | | after recent fixes we need to raise the version to 1.2.1 so that we can require also the right patched version.
* tdb: fix an early release of the global lock that can cause data corruptionVolker Lendecke2010-02-011-5/+10
| | | | | | | | | | | | | | | | | | | There was a bug in tdb where the tdb_brlock(tdb, GLOBAL_LOCK, F_UNLCK, F_SETLKW, 0, 1); (ending the transaction-"mutex") was done before the /* remove the recovery marker */ This means that when a transaction is committed there is a window where another opener of the file sees the transaction marker while the transaction committer is still fully functional and working on it. This led to transaction being rolled back by that second opener of the file while transaction_commit() gave no error to the caller. This patch moves the F_UNLCK to after the recovery marker was removed, closing this window.
* tdb: fix standalone 'make installdocs'Stefan Metzmacher2010-01-062-3/+4
| | | | metze
* tdb: create symbol links to shared libraries see ↵Brian Lu2010-01-061-0/+4
| | | | | | https://bugzilla.samba.org/show_bug.cgi?id=6991 for details Signed-off-by: Stefan Metzmacher <metze@samba.org>
* tdb: Also build and install tdb manpages from standalone tdb.Jelmer Vernooij2009-12-217-3/+459
|
* tdb: Fix formatting of API check file.Jelmer Vernooij2009-12-211-1/+1
|
* tdbtool: avoid using c++ reserved words.Günther Deschner2009-12-171-2/+2
| | | | Guenther
* Fix release script with newer versins of gitSimo Sorce2009-12-071-1/+1
|
* tdb tools: Mostly cosmetic adaptionsMatthias Dieter Wallnöfer2009-11-202-8/+9
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* tdb: change version to 1.2.0 after adding TDB_*ALLOW_NESTINGStefan Metzmacher2009-11-201-1/+1
| | | | metze
* tdb: add TDB_DISALLOW_NESTING and make TDB_ALLOW_NESTING the default behaviorStefan Metzmacher2009-11-205-3/+63
| | | | | | | | | | We need to keep TDB_ALLOW_NESTING as default behavior, so that existing code continues to work. However we may change the default together with a major version number change in future. metze
* New attempt at TDB transaction nesting allow/disallow.Ronnie Sahlberg2009-11-202-1/+14
| | | | | | | | | | | Make the default be that transaction is not allowed and any attempt to create a nested transaction will fail with TDB_ERR_NESTING. If an application can cope with transaction nesting and the implicit semantics of tdb_transaction_commit(), it can enable transaction nesting by using the TDB_ALLOW_NESTING flag. (cherry picked from ctdb commit 3e49e41c21eb8c53084aa8cc7fd3557bdd8eb7b6) Signed-off-by: Stefan Metzmacher <metze@samba.org>
* tdb: always set tdb->tracefd to -1 to be safe on goto failStefan Metzmacher2009-11-201-4/+3
| | | | metze
* tdb: Fix a C++ warningVolker Lendecke2009-11-081-1/+2
|
* tdb: update README a bitKirill Smelkov2009-10-291-8/+1
| | | | | | | | | | | | | | While studying tdb, I've noticed a couple of mismatches between readme and actual code: - tdb_open_ex changed it's log_fn argument to log_ctx - there is now no tdb_update(), which it seems was transformed into non-exported tdb_update_hash() There were other mismatches, but I don't remember them now, sorry. Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb: add tests for double .close() in pytdbKirill Smelkov2009-10-291-0/+9
| | | | | | | | | | | | | | | | | | | | | | | The reason I do it is that when using older python-tdb as shipped in Debian Lenny, python interpreter crashes on this test: (gdb) bt #0 0xb7f8c424 in __kernel_vsyscall () #1 0xb7df5640 in raise () from /lib/i686/cmov/libc.so.6 #2 0xb7df7018 in abort () from /lib/i686/cmov/libc.so.6 #3 0xb7e3234d in __libc_message () from /lib/i686/cmov/libc.so.6 #4 0xb7e38624 in malloc_printerr () from /lib/i686/cmov/libc.so.6 #5 0xb7e3a826 in free () from /lib/i686/cmov/libc.so.6 #6 0xb7b39c84 in tdb_close () from /usr/lib/libtdb.so.1 #7 0xb7b43e14 in ?? () from /var/lib/python-support/python2.5/_tdb.so #8 0x0a038d08 in ?? () #9 0x00000000 in ?? () master's pytdb does not (we have a check for self->closed in obj_close()), but still... Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb: reset tdb->fd to -1 in tdb_close()Kirill Smelkov2009-10-291-1/+3
| | | | | | | | So that erroneous double tdb_close() calls do not try to close() same fd again. This is like SAFE_FREE() but for fd. Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb: fix typo in python's Tdb.get() docstringKirill Smelkov2009-10-291-1/+1
| | | | | | | It's Tdb.get(), not Tdb.fetch(). Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb: kill last bits from swigKirill Smelkov2009-10-292-6/+1
| | | | | | | | We no longer use swig for pytdb, so there is no need for swig make rules. Also pytdb.c header should be updated. Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb: detect tdb store of identical records and skipAndrew Tridgell2009-10-251-0/+20
| | | | This can help with ldb where we rewrite the index records
* tdb: rename 'struct list_struct' into 'struct tdb_record'Stefan Metzmacher2009-10-239-54/+54
| | | | metze
* lib/tdb: make tdbtool use tdb_check() for "check" commandRusty Russell2009-10-221-14/+30
| | | | | | | Also, set logging function so we get more informative messages. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* lib/tdb: add tdb_check()Rusty Russell2009-10-228-3/+441
| | | | | | | | ctdb wants a quick way to detect corrupt tdbs; particularly, tdbs with loops in their hash chains. tdb_check() provides this. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* lib/tdb: add -t (always use transactions) option to tdbtortureRusty Russell2009-10-221-12/+29
| | | | | | | This means you can kill it at any time and expect no corruption. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* lib/tdb: wean off TDB_ERRCODE.Rusty Russell2009-10-229-40/+59
| | | | | | | | | | It was a regrettable hack which I used to reduce line count in tdb; in fact it caused confusion as can be seen in this patch. In particular, ecode now needs to be set before TDB_LOG anyway, and having it exposed in the header is useless (the struct tdb_context isn't defined, so it's doubly useless). Also, we should never set errno, as io.c was doing. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* lib/tdb: TDB_TRACE support (for developers)Rusty Russell2009-10-227-55/+402
| | | | | | | | | | | | | When TDB_TRACE is defined (in tdb_private.h), verbose tracing of tdb operations is enabled. This can be replayed using "replay_trace" from http://ccan.ozlabs.org/info/tdb. The majority of this patch comes from moving internal functions to _<funcname> to avoid double-tracing. There should be no additional overhead for the normal (!TDB_TRACE) case. Note that the verbose traces compress really well with rzip. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb: fixed the intermittent failure of tdbtorture in the build farmAndrew Tridgell2009-10-201-2/+5
| | | | | | | | There was a race condition that caused the torture.tdb to be left in a state that needed recovery. The torture code thought that any message from the tdb code was an error, so the "recovered" message, which is a TDB_DEBUG_TRACE message, marked the run as being an error when it isn't.
* tdb:tdbtool: fix indentation.Michael Adam2009-09-211-178/+177
| | | | Michael
* tdb:tdbtool: add transaction_start/_commit/_cancel commands.Michael Adam2009-09-211-0/+21
| | | | | | So one can perform tdbtool operations protected by transactions. Michael
* tdb:tdbtool: add the "speed" command to the help text.Michael Adam2009-09-211-0/+1
| | | | Michael
* tdb: increase minor versionAndrew Tridgell2009-09-191-1/+1
| | | | we depend on reads in transactions for s4 replication
* tdb: allow reads after prepare commitAndrew Tridgell2009-09-151-8/+0
| | | | | | We previously only allowed a commit to happen after a prepare commit. It is in fact safe to allow reads between a prepare and a commit, and the s4 replication code can make use of that, so allow it.
* tdb:mksigs: allow PRINTF_ATTRIBUTE(..) macros function types as funcion argsMichael Adam2009-09-111-1/+1
| | | | Michael
* tdb:mksigs: normalize bool -> _BoolMichael Adam2009-09-111-0/+3
| | | | Michael
* tdb:mksigs: ignore symbols (like _DEPRECATED_) after closing function ↵Michael Adam2009-09-111-0/+1
| | | | | | parentheses Michael
* tdb:mksigs: correctly ignode multiline function typedefsMichael Adam2009-09-111-5/+5
| | | | | | by first concatenating multilint parentheses and removing typefes afterwards. Michael
* tdb:mksigs: ignore struct forward declarations.Michael Adam2009-09-111-0/+1
| | | | Michael
* tdb:mksyms: allow characters after closing functions parenthesis.Michael Adam2009-09-111-2/+2
| | | | Michael
* tdb:mksyms: allow double pointer return value of functions.Michael Adam2009-09-111-1/+1
| | | | Michael
* tdb: fix c++ build warning.Günther Deschner2009-09-071-2/+2
| | | | Guenther
* One would expect I could spell my name...Michael Adam2009-08-301-1/+1
|
* tdb: move the original abi_checks script to script/abi_checks_gcc.shMichael Adam2009-08-301-0/+0
| | | | Michael
* tdb: run abi_checks as part of "make test".Michael Adam2009-08-301-0/+2
| | | | | | | Strange: I had to place "test:: abi_checks" before the main "test::" target here, otherwise the abi checks would not get run. Michael
* tdb: remove files generated by "make abi_checks" in "make clean".Michael Adam2009-08-301-0/+2
| | | | Michael
* tdb: add a target "abi_checks" to tdb.Michael Adam2009-08-301-0/+4
| | | | | | Simply run "make abi_checks" to call the abi check script appropriately. Michael