summaryrefslogtreecommitdiffstats
path: root/ctdb/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* tdb: fix typo in python's Tdb.get() docstringKirill Smelkov2009-12-161-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> (cherry picked from samba commit cfed5f946de0992a594c189ee3c19cf98e59d380) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 76aacdd8e1106f26565e25903091a757b59cd7e2)
* tdb: detect tdb store of identical records and skipAndrew Tridgell2009-12-161-0/+20
| | | | | | | | | This can help with ldb where we rewrite the index records (cherry picked from samba commit d4c0e8fdf063f88032c32de7ece60d502b322089) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 470750fa2e3cf987f10de48451b1ee13aab03907)
* tdb: rename 'struct list_struct' into 'struct tdb_record'Stefan Metzmacher2009-12-169-54/+54
| | | | | | | | | metze (cherry picked from samba commit 3b62e250c066f44d0ab08a7db037b6b4f74a914b) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 03b3682e3fa53c9f5fdf2c4beac8b5d030fd2630)
* lib/tdb: make tdbtool use tdb_check() for "check" commandRusty Russell2009-12-161-14/+30
| | | | | | | | | | | Also, set logging function so we get more informative messages. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (cherry picked from samba commit 094493115971cf3d5a3138ff10ebe02335824723) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 6ac7ef8bf4d384f880c7f483ace70f8e08c15a8b)
* lib/tdb: add tdb_check()Rusty Russell2009-12-166-3/+439
| | | | | | | | | | | | | 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> (cherry picked from samba commit 022b4d4aa6861c1e3e6d76484d92555221cb6d14) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit df1a3ce0380fa9d8722b2f9b16f65557095e4c83)
* tdb: kill last bits from swigKirill Smelkov2009-12-161-1/+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> (cherry picked from samba commit ecbe5ebd8d1c44a478c613eb1cace0521142d0d3) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 27611d6a0c313732e438cb24c82b9de126e50156)
* lib/tdb: sync build files from samba masterStefan Metzmacher2009-12-1623-1244/+513
| | | | | | | | metze Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 1d5c5a221c28f1dc652a80ed516a0f18ba588d9f)
* s3 build: Remove unused fstat check to fix a bunch of HAVE_FSTAT warnings ↵Stefan Metzmacher2009-12-161-4/+0
| | | | | | | | (cherry picked from samba commit 2c2545d45af9c7479bf032fff1263e102926a495) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit c40d14b1b7ba7c9ae40c0306a2e552504e0f92a6)
* lib/tdb: include replace.h and system/filesys.h in pytdb.cStefan Metzmacher2009-12-161-4/+3
| | | | | | | | | | | This fixes the build on Tru64. metze (cherry picked from samba commit 3718cf294ad1f3e00178cb34b2c914c9aecf2016) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 5652e403be099f35cdd29fda8ba4fe2c35de8035)
* Avoid using a utility header for Python replacements included in Samba, ↵Stefan Metzmacher2009-12-162-32/+5
| | | | | | | | since this will not be shipped with talloc/tdb/tevent/etc. (cherry picked from samba commit ba5d6e6d706ebf07640ee24d701255cbb4803525) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit da47169c4d3bc1b446b49610d892df05638e912c)
* s3/s4 build: Fix Py_RETURN_NONE to work with python versions < 2.4 (cherry ↵Stefan Metzmacher2009-12-162-1/+32
| | | | | | | | picked from samba commit 61a23c5eea2203721a70a4ad41bfdc6cd1d6a2a7) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 4130c5dd10869b071124e2bf04d6807bbb11ab1f)
* py: Properly increase the reference counter of Py_None. (cherry picked from ↵Stefan Metzmacher2009-12-161-16/+16
| | | | | | | | samba commit d2c70d24e12293d9b4272eb310a6a4c4582b2d92) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit e7242221c3318a5c312e17ff4074bef80b639ca8)
* Make sure to not close tdb database more than once. (cherry picked from ↵Jelmer Vernooij2009-12-161-2/+10
| | | | | | | | samba commit 6fe6983e4c960abc69d5fa80cbef534ae515209a) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 52f78e040749d24058ee1f575d949b57d15f5987)
* Implement missing functions in pytdb. (cherry picked from samba commit ↵Jelmer Vernooij2009-12-162-34/+66
| | | | | | | | 2da551bbcc6cab296769c193b0b82aaa6256cece) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 3a671b11770057c91e0ae646499d4714f52bc5c0)
* Add simple manually written replacement for the tdb module. (cherry picked ↵Stefan Metzmacher2009-12-163-0/+609
| | | | | | | | from samba commit 2a61fd41e9d4d2e3d7b47a816544c88bb369bc03) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 2231ee0aa163d68383dd9636f25f033fe7c1f3e7)
* tdb: Add simple reimplementation of tdbdump in Python as an example of the ↵Jelmer Vernooij2009-12-161-0/+12
| | | | | | | | tdb Python bindings. (This used to be commit 47d797f7885b1e7bcff724496ecb1990e8440eea) (cherry picked from samba commit 6bdd1425b75c8931965f0e5627f5a63dc6820a7c) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 363c34d4bb488609317794cd3153d85c12643110)
* Remove unecessary msync. Jeremy. (cherry picked from samba commit ↵Jeremy Allison2009-12-161-4/+0
| | | | | | | | 0bae1ef3de8fda5e1e2d641b14a408e627396912) (This used to be commit db2acaf46fdc38078b6b28b68909e289f6c9e0ec) (cherry picked from samba commit a1cf3ad5d655cf5a847df6d6299b3af1a30ec1e3) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 236dc2fa29b3c0caec51859dbd469f0a13f5917e)
* The msync manpage reports that msync *must* be called before munmap. Failure ↵Stefan Metzmacher2009-12-162-2/+8
| | | | | | | | to do so may result in lost data. Fix an ifdef check, I really think we meant to check HAVE_MMAP here. (cherry picked from samba commit 74c8575b3f3b90ea21ae6aa7ccd95947838af956) (This used to be commit 8fd54bb55f0c23bd025d1719abcbe75c6a2ea8ac) (cherry picked from samba commit b39e332bd7803dd4ce8267f750c497b5deb837ee) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 5aa0ab328c36ecd4d7ec03f921e6027340c2ef13)
* Attempt to fix bug 5684Volker Lendecke2009-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | With the ctdb checkin dde9f3f006 tdb optimized out write lock checks for write-enabled transaction. Sadly, this also removed the possibility to ever remove dead records left over from tdb_delete calls within a transaction. Tridge, please check this! Did dde9f3f006 have any reason beyond performance optimizations? Thanks, Volker (cherry picked from samba commit 3f884c4ae36f3260e63626bdd4989d9258ae6497) (This used to be commit 1d85e0647e287d269b3f6b534da88f497d6f76c3) (cherry picked from samba commit 8c88209c6f4b57b0dbe1459bd5bc583c5d321758) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit b02bf7659f04f1fa203834bd75a2392b48e56c16)
* lib/tdb/tools/tdbtorture.c: fixed memory leak.Slava Semushin2009-12-161-0/+2
| | | | | | | | | | Found by cppcheck: [lib/tdb/tools/tdbtorture.c:326]: (error) Memory leak: pids (cherry picked from samba commit 497b9e460b5defd60de89b9c5bed890f83ca86a1) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 5d4cc4b018a538dc3f1d79fe091f3e6e67003daf)
* added basic testing of tdb_transaction_prepare_commit() in tdbtorture ↵Andrew Tridgell2009-12-161-0/+6
| | | | | | | | (cherry picked from samba commit 84547b8dba3c0cf4e20b3c50d9386081d475df6b) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 923b61fe722c0aec8a5b6ac8dd1df74957dc102b)
* make tdbbackup use transactionsAndrew Tridgell2009-12-161-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 (cherry picked from samba commit 2e4247782bd5812bc8e7ea24194c8436748bb2fa) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit cd23d36ada9631095ca68663516de0c8d8c3bbed)
* fixed tdbbackup to give tdb error messages (cherry picked from samba commit ↵Andrew Tridgell2009-12-161-7/+31
| | | | | | | | 08be1420ba52ef9bba90d0f811c7810841ee8568) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 3d44412593b8748a5158e15b83cd9eb548231194)
* lib/tdb: add -t (always use transactions) option to tdbtortureRusty Russell2009-12-161-12/+29
| | | | | | | | | | | | This means you can kill it at any time and expect no corruption. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (cherry picked from samba commit 0fc6800005ffb532a5e5699c97f13f1de138d51f) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit f7278a277ed91587cae5b5e3660dad7124bdb73f)
* lib/tdb: wean off TDB_ERRCODE.Rusty Russell2009-12-169-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> (cherry picked from samba commit b77f41d58b05101e02d8ac0e54cb0e30807d89c2) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit a6620f6e74aadc708395b21b42303d1082192fcc)
* lib/tdb: TDB_TRACE support (for developers)Rusty Russell2009-12-167-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> (cherry picked from samba commit 703004340c3e0f43f741bd368d2525cfd187d590) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit b01b756cb577f32a1ec4597efb00017241e01685)
* tdb: fixed the intermittent failure of tdbtorture in the build farmAndrew Tridgell2009-12-161-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. (cherry picked from samba commit 5dcf0069b68149575fe6166019dd90b73885926b) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 43c97b259b19c42b4edc7f83dbfc5e486568b4e3)
* tdb:tdbtool: fix indentation.Michael Adam2009-12-161-178/+177
| | | | | | | | | Michael (cherry picked from samba commit e440a2e11e78a562f97971c0dfe0cf3f694996ff) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit c1b8d32b4ef87b9d8f37b451f47fcee2ea753d21)
* Fix all warnings in source3 with gcc4.3. Jeremy. (cherry picked from samba ↵Stefan Metzmacher2009-12-161-1/+3
| | | | | | | | commit 07e0094365e8dc360a83eec2e7cf9b1d5d8d6d00) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit e4d49c182e12c2d429d0414209cc2c8ccc19dc91)
* s3/s4: Fix "shadows a global declaration" warning (cherry picked from samba ↵Tim Prouty2009-12-161-1/+1
| | | | | | | | commit e48a5cd5d4fc2626b09af16a0ac68c638d081437) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 94f5728a77b8c772fb16c4744c24b45de8016e52)
* tdb: Fix some recently introduced warnings in tdbtool (cherry picked from ↵Tim Prouty2009-12-161-6/+6
| | | | | | | | samba commit c299833bf8e6506c793d6e8283743949aaac9ef4) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 5830a2427b84e1cce74390b58fe12c45b5a056a6)
* added some more speed tests to tdbtoolAndrew Tridgell2009-12-161-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 (cherry picked from samba commit e15027155d3d880abde83124e252b3dd10a9aae4) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 463279c972fa4538919bdd1dff48ca6b2fb8d49c)
* tdb:tdbtool: add transaction_start/_commit/_cancel commands.Michael Adam2009-12-161-0/+21
| | | | | | | | | | | So one can perform tdbtool operations protected by transactions. Michael (cherry picked from samba commit 91e1bab2e9a3f33151061554f2dcf05bcb728312) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 35a5b874b925380f7c227e47aebb590c9db4739e)
* tdb:tdbtool: add the "speed" command to the help text.Michael Adam2009-12-161-0/+1
| | | | | | | | | Michael (cherry picked from samba commit 817383d88d820e7be5b5dd3d2da350d4a03a94de) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit dc287a7d7420cca0b104049e689a73202bc535f8)
* Added a simple tdb integrity check to tdbtool. The command "check" runs ↵Holger Hetterich2009-12-161-1/+28
| | | | | | | | traverse on the currently open tdb, and returns the number of entries if the integrity check is successful. (cherry picked from samba commit 42366bcbbdd42bb9d5821dfcc9dbe71a1eafa330) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 02b35ba77672727c96ad004be37c7f6f1d3fe474)
* tdb: allow reads after prepare commitAndrew Tridgell2009-12-161-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. (cherry picked from samba commit 46c99ec2a3781d53138245182345c6c2ddd9a258) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 5ef5ddb8369e5e76173285fe9a08498dc8dc73ab)
* tdb:mksigs: allow PRINTF_ATTRIBUTE(..) macros function types as funcion argsMichael Adam2009-12-161-1/+1
| | | | | | | | | Michael (cherry picked from samba commit 55dcf928eb6ce603c5e95a9a80856a4deb33d0c6) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit ef1dc585d869a9e48164cd65bafc92c1da245007)
* tdb:mksigs: normalize bool -> _BoolMichael Adam2009-12-161-0/+3
| | | | | | | | | Michael (cherry picked from samba commit cfa4e7ec7540d1100649839a10968303189fe929) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 0ae735b7a2096a40e5e47086ec41d9d45ef6d36b)
* tdb:mksigs: ignore symbols (like _DEPRECATED_) after closing function ↵Michael Adam2009-12-161-0/+1
| | | | | | | | | | | parentheses Michael (cherry picked from samba commit 25939a627f15b7a21110767d47be0f50f32d3943) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 2e69647404c87c438ae7c180277ac3b532941efd)
* tdb:mksigs: correctly ignode multiline function typedefsMichael Adam2009-12-161-5/+5
| | | | | | | | | | | by first concatenating multilint parentheses and removing typefes afterwards. Michael (cherry picked from samba commit 13bfcd5a93c47c9db8b644560a1bcc398facb136) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 37225f1ed3f70d7259c2af2c51c671105c34476a)
* tdb:mksigs: ignore struct forward declarations.Michael Adam2009-12-161-0/+1
| | | | | | | | | Michael (cherry picked from samba commit ecd12bfb382da072595391d5bf11a893d39a0479) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 66fffa577e051212ac7541be906b6c80f4a7c0c9)
* tdb:mksyms: allow characters after closing functions parenthesis.Michael Adam2009-12-161-2/+2
| | | | | | | | | Michael (cherry picked from samba commit 400f08450b26f38a7dafd1d458542b4d9a8cb19e) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 310d673b7cb9000d76437d78e43bc2bf133e4e14)
* tdb:mksyms: allow double pointer return value of functions.Michael Adam2009-12-161-1/+1
| | | | | | | | | Michael (cherry picked from samba commit 907e05595fdcc4ef77ad627bc0f3732faa59de68) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit f70e371d70e334a7254649b2bb09aa382e6f09bb)
* tdb: fix c++ build warning.Günther Deschner2009-12-161-2/+2
| | | | | | | | | Guenther (cherry picked from samba commit 1c2f4919abe99d07540b7380ad16d475d62aa50b) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 9d5015e6fc68d3eb9e7b7178dbaf8c129dc79471)
* One would expect I could spell my name... (cherry picked from samba commit ↵Michael Adam2009-12-161-1/+1
| | | | | | | | 0d120be36bfc561e3f679d081993ccc6bea2a401) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit efa4a795db7fb2bddaab3969850d1554fc5f4da1)
* tdb: add script/abi_checks.sh. check for abi changes without gcc magic.Michael Adam2009-12-161-0/+91
| | | | | | | | | | | | | | USAGE: abi_checks.sh LIBRARY_NAME header1 [header2 ...] This creates symbol signature lists using the mksyms and mksigs scripts and compares them with the checked in lists. Michael (cherry picked from samba commit 9636e0d373e75cce7063b710227eaaf53f447c1b) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 724d71dc838750fff91a45359feeb6e71bf0a4c7)
* tdb: add script to extract signatures from header files.Michael Adam2009-12-161-0/+178
| | | | | | | | | | | | | | | | | This produces output like the output gcc produces when invoked with the -aux-info switch. Run like this: cat include/tdb.h | ./script/mksigs.pl This simple parser is probably too coarse to handle all possible header files, but it treats tdb.h correctly... Michael (cherry picked from samba commit 0760a04ef9f7d2f3d966017295712769d02b8b9f) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 141422d9dc24b15b7b8bc7831adab90367a729f7)
* tdb: add scripts to extract library symbols (exports file) from headersMichael Adam2009-12-162-0/+121
| | | | | | | | | Michael (cherry picked from samba commit 006fd0c43c7c403b8671dfc46e5ee31e92480e1f) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit aed864dceaf6ec1e6e6066a587c708b485901200)
* lib/tdb: don't overwrite TDBs with different version numbers.Rusty Russell2009-12-161-5/+7
| | | | | | | | | | | In future, this may happen, and we don't want to clobber them. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (cherry picked from samba commit 398d0c2929026fccb3409316720a4dcad225ab05) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit eebd467961dad6cfb38c2a5d6e4b4dbf86e55e63)
* Add define guards around otherwise unused variable. Jeremy. (cherry picked ↵Jeremy Allison2009-12-161-0/+3
| | | | | | | | from samba commit 4fc9f9c3f943cdeb27e37f0ee068cdd0da7cb00c) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 6f8614de0f20d4c507aecd744d9c3f6545078127)