1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
Commit Graph

311 Commits

Author SHA1 Message Date
Rusty Russell
b0a4a82370 lib/tdb: add tdb_check()
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 022b4d4aa6)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit df1a3ce0380fa9d8722b2f9b16f65557095e4c83)
2009-12-16 08:03:52 +01:00
Kirill Smelkov
b4bb5257f6 tdb: kill last bits from swig
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 ecbe5ebd8d)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 27611d6a0c313732e438cb24c82b9de126e50156)
2009-12-16 08:03:52 +01:00
Stefan Metzmacher
42d131d951 lib/tdb: sync build files from samba master
metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 1d5c5a221c28f1dc652a80ed516a0f18ba588d9f)
2009-12-16 08:03:52 +01:00
Stefan Metzmacher
4576b9aae8 s3 build: Remove unused fstat check to fix a bunch of HAVE_FSTAT warnings (cherry picked from samba commit 2c2545d45a)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit c40d14b1b7ba7c9ae40c0306a2e552504e0f92a6)
2009-12-16 08:03:51 +01:00
Stefan Metzmacher
a60db0255b lib/tdb: include replace.h and system/filesys.h in pytdb.c
This fixes the build on Tru64.

metze
(cherry picked from samba commit 3718cf294a)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 5652e403be099f35cdd29fda8ba4fe2c35de8035)
2009-12-16 08:03:51 +01:00
Stefan Metzmacher
c0131bbcc7 Avoid using a utility header for Python replacements included in Samba, since this will not be shipped with talloc/tdb/tevent/etc. (cherry picked from samba commit ba5d6e6d70)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit da47169c4d3bc1b446b49610d892df05638e912c)
2009-12-16 08:03:51 +01:00
Stefan Metzmacher
c5827f2c2d s3/s4 build: Fix Py_RETURN_NONE to work with python versions < 2.4 (cherry picked from samba commit 61a23c5eea)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 4130c5dd10869b071124e2bf04d6807bbb11ab1f)
2009-12-16 08:03:51 +01:00
Stefan Metzmacher
31bc9f3ee1 py: Properly increase the reference counter of Py_None. (cherry picked from samba commit d2c70d24e1)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit e7242221c3318a5c312e17ff4074bef80b639ca8)
2009-12-16 08:03:51 +01:00
Jelmer Vernooij
fc9d260310 Make sure to not close tdb database more than once. (cherry picked from samba commit 6fe6983e4c)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 52f78e040749d24058ee1f575d949b57d15f5987)
2009-12-16 08:03:51 +01:00
Jelmer Vernooij
c9907f2634 Implement missing functions in pytdb. (cherry picked from samba commit 2da551bbcc)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 3a671b11770057c91e0ae646499d4714f52bc5c0)
2009-12-16 08:03:51 +01:00
Stefan Metzmacher
50ceb83180 Add simple manually written replacement for the tdb module. (cherry picked from samba commit 2a61fd41e9)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 2231ee0aa163d68383dd9636f25f033fe7c1f3e7)
2009-12-16 08:03:50 +01:00
Jelmer Vernooij
4c69b5e0fd tdb: Add simple reimplementation of tdbdump in Python as an example of the tdb Python bindings. (This used to be commit 47d797f788) (cherry picked from samba commit 6bdd1425b7)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 363c34d4bb488609317794cd3153d85c12643110)
2009-12-16 08:03:50 +01:00
Jeremy Allison
e58068d666 Remove unecessary msync. Jeremy. (cherry picked from samba commit 0bae1ef3de) (This used to be commit db2acaf46f) (cherry picked from samba commit a1cf3ad5d6)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 236dc2fa29b3c0caec51859dbd469f0a13f5917e)
2009-12-16 08:03:50 +01:00
Stefan Metzmacher
61c7444943 The msync manpage reports that msync *must* be called before munmap. Failure 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 74c8575b3f) (This used to be commit 8fd54bb55f) (cherry picked from samba commit b39e332bd7)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 5aa0ab328c36ecd4d7ec03f921e6027340c2ef13)
2009-12-16 08:03:50 +01:00
Volker Lendecke
a3b4f9b59e Attempt to fix bug 5684
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 3f884c4ae3)
(This used to be commit 1d85e0647e)
(cherry picked from samba commit 8c88209c6f)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit b02bf7659f04f1fa203834bd75a2392b48e56c16)
2009-12-16 08:03:50 +01:00
Slava Semushin
06ab3cfe60 lib/tdb/tools/tdbtorture.c: fixed memory leak.
Found by cppcheck:
[lib/tdb/tools/tdbtorture.c:326]: (error) Memory leak: pids
(cherry picked from samba commit 497b9e460b)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 5d4cc4b018a538dc3f1d79fe091f3e6e67003daf)
2009-12-16 08:03:50 +01:00
Andrew Tridgell
3e04b100c1 added basic testing of tdb_transaction_prepare_commit() in tdbtorture (cherry picked from samba commit 84547b8dba)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 923b61fe722c0aec8a5b6ac8dd1df74957dc102b)
2009-12-16 08:03:50 +01:00
Andrew Tridgell
5b6b852691 make tdbbackup use transactions
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 2e4247782b)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit cd23d36ada9631095ca68663516de0c8d8c3bbed)
2009-12-16 08:03:49 +01:00
Andrew Tridgell
6eaaa52a1d fixed tdbbackup to give tdb error messages (cherry picked from samba commit 08be1420ba)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 3d44412593b8748a5158e15b83cd9eb548231194)
2009-12-16 08:03:49 +01:00
Rusty Russell
b52a06ffc6 lib/tdb: add -t (always use transactions) option to tdbtorture
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 0fc6800005)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit f7278a277ed91587cae5b5e3660dad7124bdb73f)
2009-12-16 08:03:49 +01:00
Rusty Russell
8dcc760f1e lib/tdb: wean off TDB_ERRCODE.
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 b77f41d58b)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit a6620f6e74aadc708395b21b42303d1082192fcc)
2009-12-16 08:03:49 +01:00
Rusty Russell
7f857c4d14 lib/tdb: TDB_TRACE support (for developers)
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 703004340c)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit b01b756cb577f32a1ec4597efb00017241e01685)
2009-12-16 08:03:49 +01:00
Andrew Tridgell
805ef91707 tdb: fixed the intermittent failure of tdbtorture in the build farm
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 5dcf0069b6)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 43c97b259b19c42b4edc7f83dbfc5e486568b4e3)
2009-12-16 08:03:49 +01:00
Michael Adam
8fd54bbbe1 tdb:tdbtool: fix indentation.
Michael
(cherry picked from samba commit e440a2e11e)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit c1b8d32b4ef87b9d8f37b451f47fcee2ea753d21)
2009-12-16 08:03:48 +01:00
Stefan Metzmacher
42648556a6 Fix all warnings in source3 with gcc4.3. Jeremy. (cherry picked from samba commit 07e0094365)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit e4d49c182e12c2d429d0414209cc2c8ccc19dc91)
2009-12-16 08:03:48 +01:00
Tim Prouty
a04fecb1c2 s3/s4: Fix "shadows a global declaration" warning (cherry picked from samba commit e48a5cd5d4)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 94f5728a77b8c772fb16c4744c24b45de8016e52)
2009-12-16 08:03:48 +01:00
Tim Prouty
c8366fcfb4 tdb: Fix some recently introduced warnings in tdbtool (cherry picked from samba commit c299833bf8)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 5830a2427b84e1cce74390b58fe12c45b5a056a6)
2009-12-16 08:03:48 +01:00
Andrew Tridgell
e0bed62820 added some more speed tests to tdbtool
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 e15027155d)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 463279c972fa4538919bdd1dff48ca6b2fb8d49c)
2009-12-16 08:03:48 +01:00
Michael Adam
886cb3e86d tdb:tdbtool: add transaction_start/_commit/_cancel commands.
So one can perform tdbtool operations protected by transactions.

Michael
(cherry picked from samba commit 91e1bab2e9)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 35a5b874b925380f7c227e47aebb590c9db4739e)
2009-12-16 08:03:48 +01:00
Michael Adam
168bb40b4b tdb:tdbtool: add the "speed" command to the help text.
Michael
(cherry picked from samba commit 817383d88d)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit dc287a7d7420cca0b104049e689a73202bc535f8)
2009-12-16 08:03:47 +01:00
Holger Hetterich
0a0281444d Added a simple tdb integrity check to tdbtool. The command "check" runs traverse on the currently open tdb, and returns the number of entries if the integrity check is successful. (cherry picked from samba commit 42366bcbbd)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 02b35ba77672727c96ad004be37c7f6f1d3fe474)
2009-12-16 08:03:47 +01:00
Andrew Tridgell
09f7874151 tdb: allow reads after prepare commit
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 46c99ec2a3)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 5ef5ddb8369e5e76173285fe9a08498dc8dc73ab)
2009-12-16 08:03:46 +01:00
Michael Adam
d05b49aaf2 tdb:mksigs: allow PRINTF_ATTRIBUTE(..) macros function types as funcion args
Michael
(cherry picked from samba commit 55dcf928eb)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit ef1dc585d869a9e48164cd65bafc92c1da245007)
2009-12-16 08:03:46 +01:00
Michael Adam
ab37ff7c04 tdb:mksigs: normalize bool -> _Bool
Michael
(cherry picked from samba commit cfa4e7ec75)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 0ae735b7a2096a40e5e47086ec41d9d45ef6d36b)
2009-12-16 08:03:46 +01:00
Michael Adam
a0dba36390 tdb:mksigs: ignore symbols (like _DEPRECATED_) after closing function parentheses
Michael
(cherry picked from samba commit 25939a627f)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 2e69647404c87c438ae7c180277ac3b532941efd)
2009-12-16 08:03:46 +01:00
Michael Adam
6d9ce0ef50 tdb:mksigs: correctly ignode multiline function typedefs
by first concatenating multilint parentheses and removing typefes afterwards.

Michael
(cherry picked from samba commit 13bfcd5a93)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 37225f1ed3f70d7259c2af2c51c671105c34476a)
2009-12-16 08:03:46 +01:00
Michael Adam
67da31e222 tdb:mksigs: ignore struct forward declarations.
Michael
(cherry picked from samba commit ecd12bfb38)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 66fffa577e051212ac7541be906b6c80f4a7c0c9)
2009-12-16 08:03:45 +01:00
Michael Adam
67d7709140 tdb:mksyms: allow characters after closing functions parenthesis.
Michael
(cherry picked from samba commit 400f08450b)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 310d673b7cb9000d76437d78e43bc2bf133e4e14)
2009-12-16 08:03:44 +01:00
Michael Adam
31b9126d29 tdb:mksyms: allow double pointer return value of functions.
Michael
(cherry picked from samba commit 907e05595f)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit f70e371d70e334a7254649b2bb09aa382e6f09bb)
2009-12-16 08:03:44 +01:00
Günther Deschner
9872a2faab tdb: fix c++ build warning.
Guenther
(cherry picked from samba commit 1c2f4919ab)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 9d5015e6fc68d3eb9e7b7178dbaf8c129dc79471)
2009-12-16 08:03:44 +01:00
Michael Adam
2b29e30df5 One would expect I could spell my name... (cherry picked from samba commit 0d120be36b)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit efa4a795db7fb2bddaab3969850d1554fc5f4da1)
2009-12-16 08:03:43 +01:00
Michael Adam
6e522eb198 tdb: add script/abi_checks.sh. check for abi changes without gcc magic.
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 9636e0d373)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 724d71dc838750fff91a45359feeb6e71bf0a4c7)
2009-12-16 08:03:43 +01:00
Michael Adam
52b657756a tdb: add script to extract signatures from header files.
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 0760a04ef9)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 141422d9dc24b15b7b8bc7831adab90367a729f7)
2009-12-16 08:03:43 +01:00
Michael Adam
53336a9cb1 tdb: add scripts to extract library symbols (exports file) from headers
Michael
(cherry picked from samba commit 006fd0c43c)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit aed864dceaf6ec1e6e6066a587c708b485901200)
2009-12-16 08:03:43 +01:00
Rusty Russell
eb9d367843 lib/tdb: don't overwrite TDBs with different version numbers.
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 398d0c2929)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit eebd467961dad6cfb38c2a5d6e4b4dbf86e55e63)
2009-12-16 08:03:43 +01:00
Jeremy Allison
41d4e2dc7c Add define guards around otherwise unused variable. Jeremy. (cherry picked from samba commit 4fc9f9c3f9)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 6f8614de0f20d4c507aecd744d9c3f6545078127)
2009-12-16 08:03:42 +01:00
Rusty Russell
e1217b7bdb There is one signedness issue in tdb which prevents traverses of TDB records over the 2G offset on systems which support 64 bit file offsets. This fixes that case.
On systems with 32 bit offsets, expansion and fcntl locking on these records
will fail anyway.  SAMBA already does '#define _FILE_OFFSET_BITS 64' in
config.h (on my 32-bit x86 Linux system at least) to get 64 bit file offsets.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(cherry picked from samba commit 252f7da702)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 2d768f664e6db65b3b7e0c732f33ee2b806892f9)
2009-12-16 08:03:42 +01:00
Volker Lendecke
b664a86bc2 Import "talloc_array_length" from upstream talloc
(This used to be ctdb commit 844aa6300ee4d87561e698001ebc15ac1e455528)
2009-12-12 00:45:39 +01:00
Volker Lendecke
a0d9bd3c13 Run only one event for each epoll_wait/select call
This might be a bit less efficient, but experience in winbind has shown that
event callbacks can trigger changes in the socket state in very hard to
diagnose ways.

(This used to be ctdb commit a78b8ea7168e5fdb2d62379ad3112008b2748576)
2009-12-10 07:52:16 +11:00
Christian Ambach
4269d37ce8 improve time jump logging
add the __location__ macro to the logs to get a better idea
in which loop the problem occured

Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>

(This used to be ctdb commit dccb549fd6a6e338063699544e52f2a1a6a966b5)
2009-12-10 07:31:04 +11:00
Rusty Russell
949803528d talloc: save errno over talloc_free
As we start to use errno more, it's a huge pain if talloc_free() can blatt
it (esp. destructors).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>


(This used to be ctdb commit 76a0ca77feba14e1e1162c195ffbdf516e62aa4d)
2009-12-07 23:05:58 +10:30
Ronnie Sahlberg
e28c652cca Dont store debug level DEBUG_DEBUG in the in-memory ringbuffer.
It is unlikely we will need something this verbose for normal troubleshooting.
This allows us to keep a significantly longer time interval of log messages
in the 500k slots available in the ringbuffer.

(This used to be ctdb commit cc99c05c0c6484ad574039a454e6133852cb41fa)
2009-12-04 11:45:37 +11:00
Ronnie Sahlberg
bc2675119d add an in memory ringbuffer where we store the last 500000 log entries regardless of log level.
add commandt to extract this in memory buffer and to clear it

(This used to be ctdb commit 29d2ee8d9c6c6f36b2334480f646d6db209f370e)
2009-11-18 12:44:18 +11:00
Ronnie Sahlberg
4d40b86805 for debugging
add a global variable holding the pid of the main daemon.
change the tracking of time() in the event loop to only check/warn when called from the main daemon

(This used to be ctdb commit a10fc51f4c30e85ada6d4b7347b0f9a8ebc76637)
2009-10-27 13:18:52 +11:00
Ronnie Sahlberg
299b027b8c patch the event loop so we read the current time every iteration.
log an error if the clock jumps backwards
also log an error if the clock jumps >5 seconds forward (we assume here we will get at least one event every 5 seconds)

(This used to be ctdb commit 11193e1e192bee6f579bdf1303153571a82711d7)
2009-10-26 13:20:35 +11:00
Ronnie Sahlberg
029fd6b00f Revert "try to restart statd everytime it fails, not just the first time"
This reverts commit 4f7b39a4871af28df1c4545ec37db179fa47a7da.

(This used to be ctdb commit db7b96304e4725f29b12398b7582e385daed63ed)
2009-09-15 19:33:35 +10:00
Ronnie Sahlberg
59cacded72 try to restart statd everytime it fails, not just the first time
(This used to be ctdb commit 4f7b39a4871af28df1c4545ec37db179fa47a7da)
2009-09-15 13:35:58 +10:00
Mathieu Parent
f095a64137 Update outdated autotools helper files.
This fixes https://bugzilla.samba.org/show_bug.cgi?id=6370
and http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=536256

Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 4899a888d4e2c31b4bd7220f3cd8936168942e61)
2009-09-09 09:52:13 +02:00
Michael Adam
ace21b84b7 debug: add debug_add and dump_data functions
Michael

(This used to be ctdb commit 64405bdbebb2ddf0ae980e958ede77df79139000)
2009-08-04 09:46:39 +02:00
Rusty Russell
3cc352f975 tdb: don't alter tdb->flags in tdb_reopen_all()
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>

(This used to be ctdb commit 8f48e37c254e0852d4e2dea54b905ce5ef2b925d)
2009-08-04 16:50:55 +09:30
Rusty Russell
ed2c8e415f tdb: Reimplementation of Metze's "lib/tdb: if we know pwrite and pread are 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>

(This used to be ctdb commit 8d0d432ab7766d9c0f9868fd77e48b9b5cc5d9f9)
2009-08-04 16:50:52 +09:30
Rusty Russell
6e4577d08f realloc() has that horrible overloaded free semantic when size is 0: current code does a free of the old record in this case, then fail.
(This used to be ctdb commit 8b6a5bba93843cd83b7b386b82949ad88f29884a)
2009-08-04 16:50:48 +09:30
Rusty Russell
1664d75ad3 If the record is at the end of the database, pretending it has length 1 might take us out-of-bounds. Only pretend to be length 1 for the malloc.
(This used to be ctdb commit 6de2823f5f7976d4efa20761e518d6b67753f054)
2009-08-04 16:50:43 +09:30
Rusty Russell
6aa98fb041 Port from SAMBA tdb: commit 54a51839ea Author: Rusty Russell <rusty@rustcorp.com.au> Date: Sat Jul 18 15:28:58 2009 +0930
Make tdb transaction lock recursive (samba version)

    This patch replaces 6ed27edbcd and
    1a416ff13c, 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>
commit 760104188d
Author: Rusty Russell <rusty@rustcorp.com.au>
Date:   Tue Jul 21 16:23:35 2009 +0930

    tdb: fix locking error

    54a51839ea "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>

(This used to be ctdb commit ce19658ba13272238058e9b9bc03e62f48b737c0)
2009-08-04 16:43:34 +09:30
Rusty Russell
825391de1d Port from SAMBA tdb: commit a6cc04a200 Author: Andrew Tridgell <tridge@samba.org> Date: Mon Jun 1 13:13:07 2009 +1000
overallocate all records by 25%

    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.

(This used to be ctdb commit e72974e5cefabc7035399d16633f727f868caa61)
2009-08-04 16:43:31 +09:30
Rusty Russell
94ee0cbe3a Port from SAMBA tdb: commit a386173fa1 Author: Andrew Tridgell <tridge@samba.org> Date: Mon Jun 1 13:11:39 2009 +1000
auto-repack in transactions that expand the tdb

    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.

(This used to be ctdb commit 233c52bfb087f636ad61e95c12616c02901f4f83)
2009-08-04 16:43:26 +09:30
Rusty Russell
3dc37c17c1 Port from SAMBA ctdb: commit 936d76802f Author: Andrew Tridgell <tridge@samba.org> Date: Tue Dec 16 14:38:17 2008 +1100
imported the tdb_repack() code from CTDB

    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

(This used to be ctdb commit fe3ceb101a5a9c336973c2c6c31406bd8181c2fe)
2009-08-04 16:43:21 +09:30
Rusty Russell
d66a7c40da Port from SAMBA tdb: commit 4b4fec65db Author: Andrew Tridgell <tridge@samba.org> Date: Thu May 28 16:08:28 2009 +1000
make TDB_NOSYNC affect all the fsync/msync calls in transactions

    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.

(This used to be ctdb commit e03980add02a28609a7a0a0c87ebc85419b98144)
2009-08-04 16:43:17 +09:30
Rusty Russell
f10db37b82 Port from SAMBA tdb: commit a91bcbccf8 Author: Jim McDonough <jmcd@samba.org> Date: Thu May 21 16:26:26 2009 -0400
Detect tight loop in tdb_find()

(This used to be ctdb commit 5253a0ba3a34fbf5810f363ecc094203d49e835f)
2009-08-04 16:43:14 +09:30
Rusty Russell
c153b85a93 Port from SAMBA tdb: commit 42c0931441 Author: Tim Prouty <tprouty@samba.org> Date: Tue Mar 31 16:24:07 2009 -0700
tdb: Remove unused variable

(This used to be ctdb commit aa22d1875b1997664af983c0baeabe34e40dd253)
2009-08-04 16:43:10 +09:30
Rusty Russell
166e74a8b1 Port from SAMBA tdb:
commit b90863c0b7
Author: Howard Chu <hyc@highlandsun.com>
Date:   Tue Mar 31 13:15:54 2009 +1100

    Add tdb_transaction_prepare_commit()

    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

(This used to be ctdb commit 4c3dac215a088947f645f727343997f5d47e3260)
2009-08-04 16:43:06 +09:30
Ronnie Sahlberg
6feb7a1bf8 New attempt at TDB transaction nesting allow/disallow.
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.

(This used to be ctdb commit 3e49e41c21eb8c53084aa8cc7fd3557bdd8eb7b6)
2009-05-25 17:04:42 +10:00
Ronnie Sahlberg
c429ca114d Revert "add TDB_NO_NESTING. When this flag is set tdb will not allow any nested transactions and tdb_transaction_start() will implicitely _cancel() any pending transactions before starting any new ones."
This reverts commit 459e4ee135bd1cd24c15e5325906eb4ecfd550ec.

(This used to be ctdb commit f1c6f7dd47bb1081781c0a0d567a92bbbc0aa5d5)
2009-05-25 16:54:25 +10:00
Ronnie Sahlberg
26e1486db7 Whitespace changes and using the CTDB_NO_MEMORY() macro changes to
the previous patch.

(This used to be ctdb commit d623ea7c04daa6349b42d50862843c9f86115488)
2009-05-21 11:49:16 +10:00
Sumit Bose
2fcedf6dac add missing checks on so far ignored return values
Most of these were found during a review by Jim Meyering <meyering@redhat.com>

(This used to be ctdb commit 3aee5ee1deb4a19be3bd3a4ce3abbe09de763344)
2009-05-21 11:22:21 +10:00
Michael Adam
01fb6e326b Remove generated binary files.
Noted by Mathieu Parent <math.parent@gmail.com>

Michael

(This used to be ctdb commit b321dfd1d23492169ac25ed901d49d7c69ad5340)
2009-05-13 16:01:53 +10:00
Ronnie Sahlberg
777c634eae add TDB_NO_NESTING. When this flag is set tdb will not allow any nested transactions and tdb_transaction_start() will implicitely _cancel() any pending transactions before starting any new ones.
(This used to be ctdb commit 459e4ee135bd1cd24c15e5325906eb4ecfd550ec)
2009-04-26 08:38:37 +10:00
Michael Adam
4e12bbbf56 autoconf: Make sure the result of the mkdir_has_mode test gets cached.
This fixes the autoconf 2.63 warning
"suspicious cache-id, must contain _cv_ to be cached".

Thanks to William Jojo <w.jojo@hvcc.edu> for reporting.

Michael

(This used to be ctdb commit f7be553ed0826d31759812d58db91589ccdf8a8c)
2009-01-29 10:24:58 +01:00
Andreas Schneider
4c64dc994e Fix circular dependency error with autoconf 2.6.3.
Signed-off-by: Andreas Schneider <anschneider@suse.de>
(cherry picked from commit b39611c36b)

Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 02893e04154c0590b235082c5a6e5726ceb25dba)
2009-01-16 20:49:52 +11:00
Andrew Tridgell
9a8d41a992 The author of the upstream code asked for this code to be GPLv2+ not GPLv3
(This used to be ctdb commit 000018f2f4fb9f2452f56731b027dd6a7beda111)
2008-09-30 07:16:17 -07:00
Andrew Tridgell
a8a8c4c1d4 merged a bugfix for the idtree code from the Linux kernel. This
matches commit 7aae6dd80e265aa9402ed507caaff4a5dba55069 in the kernel.

Many thanks to Jim Houston for pointing out this fix to us

(This used to be ctdb commit 85f6032cbdb197f3a003d86f086afa2cee898a4d)
2008-09-30 07:09:06 -07:00
Andrew Tridgell
87e19f1f9d fixed a bug where we would look for a signal past the end of the
signal arrays

This could cause the events code to get into a loop chewing CPU

(This used to be ctdb commit e24152fbd06ba4c2b6cfd473751c7f00a676b9ae)
2008-07-18 13:46:01 +10:00
Ronnie Sahlberg
ef769e7237 track both when we last started and ended a recovery.
make ctdb uptime print how long the recovery took

in the recovery daemon when we check that the public ip address
allocation on the local node is correct (we have the ips we should have
and we dont have any we shouldnt have) use ctdb uptime and check the
recovery start/stop times and make sure we dont check for ip allocation
inconsistencies during a recovery  where the ip address allocation is in flux.

(This used to be ctdb commit f86551580349b7f662f9a07e4eb0c1189e38e429)
2008-07-02 13:55:59 +10:00
Ronnie Sahlberg
ed2cf0291d second try for safe transaction stores into persistend tdb databases
for stores into persistent databases, ALWAYS use a lockwait child take out the lock for the record and never the daemon itself.

(This used to be ctdb commit 7fb6cf549de1b5e9ac5a3e4483c7591850ea2464)
2008-05-22 12:47:33 +10:00
Ronnie Sahlberg
cc5dc9fe31 dont emit the can not start transaction with locks held at all.
it just pollutes the logs

(This used to be ctdb commit c66e44d44f8d1142394ce5c6a68ac09fd67211fe)
2008-05-21 11:23:46 +10:00
Ronnie Sahlberg
26e5f71308 lower the debug level for the "can not start transaction" since we do expect this to happen a few times inside ctdb (since we cant really block and wait for all locks to dissapear before we can write the header, for example when doing a dmaster miration)
in those cases we accept that we couldnt get a transaction and then just writes the data "unsafely" anyway.

(This used to be ctdb commit 56af7df33456bf10d19b97cb005257720ac0b610)
2008-05-21 11:15:14 +10:00
Andrew Tridgell
f6ebcd6a55 carefully step around the recovery area when doing a tdb_wipe_all. This prevents
problems with wipe_all on databases that may need crash recovery

(This used to be ctdb commit e7b1349bf8784c151c2651edd99b3f40ebcece1f)
2008-02-08 14:10:54 +11:00
Andrew Tridgell
fbba202f1a fixed a problem with tdb growing after each recovery
(This used to be ctdb commit d754380961e67271809fed6c44f45356fe7a9c77)
2008-02-07 23:01:06 +11:00
Andrew Tridgell
1c35c8243e fixed a crash bug in the new transaction code
(This used to be ctdb commit 0d298e863c8ab2945fd329661c09ec6889152326)
2008-01-31 09:18:26 +11:00
Andrew Tridgell
ef02267c6e merge from samba4
(This used to be ctdb commit 21245b894b32f232251fd7c0e2fbfd073fb10514)
2008-01-18 15:48:36 +11:00
Andrew Tridgell
ce134656d5 more efficient freelist allocation
This takes advantage of the fact that we can do left merges but not right merges
By allocating data from the end of the freelist entry rather than the beginning
we can guarantee that if we immediately free the record again it will be merged
with the previous freelist entry, reducing fragmentation

(This used to be ctdb commit 6d159f2c115dd5e9b8bab8798f7ac710b4427593)
2008-01-18 13:32:54 +11:00
Andrew Tridgell
b62b7fcde8 added syslog support, and use a pipe to catch logging from child processes to the ctdbd logging functions
(This used to be ctdb commit 1306b04cd01e996fd1aa1159a9521f2ff7b06165)
2008-01-16 22:03:01 +11:00
Andrew Tridgell
840ba4d5f6 minor fix to transaction_write_existing
(This used to be ctdb commit aa4e7578f78449c518730811220666e5e34adc06)
2008-01-15 15:28:07 +11:00
Andrew Tridgell
ddbe31e5aa fixed the bug that caused tdbtorture to fail
It was an error in the new transaction code

(This used to be ctdb commit 27f0dfdfb93d92859de3cbbd3874cfb38c13a169)
2008-01-14 15:11:10 +11:00
Andrew Tridgell
35e8f2ff6c tdb_freelist_size was reporting 1 more than correct size
(This used to be ctdb commit 46214c9234c574b45bce0b88bfb3af437415a69e)
2008-01-10 09:42:44 +11:00
Andrew Tridgell
bc85af6b61 a compromise for freelist scanning - we now will look for other than the first fit, but get exponentially more desperate as we get deeper into the freelist
(This used to be ctdb commit f3319ef84c47dc8bf0bfb4ef1c72cee58ed9d88c)
2008-01-09 15:33:10 +11:00
Andrew Tridgell
96100fcae6 added two new ctdb commands:
ctdb vacuum   : vacuums all the databases, deleting any zero length
                 ctdb records

 ctdb repack   : repacks all the databases, resulting in a perfectly
                 packed database with no freelist entries

(This used to be ctdb commit 3532119c84ab3247051ed6ba21ba3243ae2f6bf4)
2008-01-08 17:23:27 +11:00
Andrew Tridgell
4322a86645 ensure tdb log messages appear in ctdbd logs
(This used to be ctdb commit b2439487832230e7b738c0f89eeaa2c0c4ba0951)
2008-01-06 12:35:49 +11:00
Andrew Tridgell
ff039b405f - added tdb_add_flags() and tdb_remove_flags()
- make freelist merging more paranoid

- fixed TDB_DATA_STAART() (broken by earlier commit)

(This used to be ctdb commit c3be8eb7d1ca316111ec51f45dbca2fa5609cf93)
2008-01-06 12:33:57 +11:00
Andrew Tridgell
841a04924c merge from Samba4
(This used to be ctdb commit 9aed7a1d065272c2e5b54872228a73f37664b526)
2008-01-05 17:41:41 +11:00
Andrew Tridgell
370779a1bb update from Samba4
(This used to be ctdb commit 298118c41bd33acd1a34a35a71a28451a45390c5)
2008-01-05 17:41:01 +11:00
Andrew Tridgell
67d2b14d90 convert tdb from u32 to uint32_t to match the current Samba trees
(This used to be ctdb commit 0dc754b7e8b0985a252885ed043949dfb7ea1ae1)
2008-01-05 17:22:47 +11:00
Andrew Tridgell
c2f84d6f4e Rewrote the tdb transaction code to be O(N) instead of O(N^2)
The previous transaction code was fast as long as you didn't do too
many writes within the transaction. The new code is a bit slower for
very small numbers of writes, but scales linearly as the number of
writes increases. The old code scaled as O(N^2) with the number of
writes, making it unusable for large N.

After testing, this needs to be merged into the Samba version of tdb,
along with many of the other recent tdb changes in the ctdb tree.

(This used to be ctdb commit bef8fe3d3ba80c7c660972c5357407f5278f7e26)
2008-01-05 17:19:47 +11:00
Andrew Tridgell
a54b88dba2 fixed data offset definition
(This used to be ctdb commit cef83d74883f6c66866fb7e5e17769322a3473da)
2008-01-05 12:10:18 +11:00
Andrew Tridgell
63b2d1c34e cleanup the new freelist code
(This used to be ctdb commit 76137104c7028b061578950d4b6b35ca8267fab1)
2008-01-05 12:09:00 +11:00
Andrew Tridgell
a21afe88bc added tdb_wipe_all() function
(This used to be ctdb commit 8e2d81cf54630970d66af92de2c0333acd2e1d22)
2008-01-05 12:08:41 +11:00
Andrew Tridgell
69fb0d3874 avoid write locks during delete checks in traversals
(This used to be ctdb commit dde9f3f0061988a0cdf10ee9e4db982c1b79ad1a)
2008-01-05 09:33:39 +11:00
Andrew Tridgell
9ea20f3916 expand tdb by minimum of 25% at a time
(This used to be ctdb commit 355575878e2b6e85268ca8387f41a19bcd9db651)
2008-01-05 09:30:09 +11:00
Andrew Tridgell
ea13223fbb prevent O(n^2) behaviour for traverse after large numbers of deletes
(This used to be ctdb commit e3c60552366f1d8d464c43efbcd6ed5a2a1adb71)
2008-01-04 12:12:02 +11:00
Andrew Tridgell
fa965dee8f quick fix for timeout in recovery
(This used to be ctdb commit 9205c681a819782d061bb41637191c130e91b100)
2008-01-02 12:04:07 +11:00
Andrew Tridgell
623e216dcf remove a incorrectly added file
(This used to be ctdb commit ff01a32db81b6c04d42634f5660181c270988264)
2007-10-19 09:30:55 +10:00
Andrew Tridgell
81bfa58d58 make sure we set close on exec on any possibly inherited fds
(This used to be ctdb commit d9dec82076f14a348e7b67b4350180681ff86f32)
2007-09-19 11:46:37 +10:00
Andrew Tridgell
8a81a03b9e merge from ronnie
(This used to be ctdb commit e06f70f064e39f1a4a394f00b81b6b1d215534d4)
2007-08-07 13:40:13 +10:00
Andrew Tridgell
5b899f0edf make timed_event structure private to events_timed.c
(This used to be ctdb commit 4a61132e2a4f6beca8e9148307c7ec16cb74bb08)
2007-07-25 11:43:27 +10:00
Andrew Tridgell
f97f2946d2 minor back-merge from samba4
(This used to be ctdb commit c591f9b2d2847f440702e7264c7da2fd6d69f4be)
2007-07-10 18:13:47 +10:00
Andrew Tridgell
a4c96397f5 more merges for GPLv3 update
(This used to be ctdb commit b7be4ee6c9a670cdf148fd36b092c3991a554964)
2007-07-10 15:46:05 +10:00
Andrew Tridgell
a78752eae4 update lib/events from samba4 (If->if)
(This used to be ctdb commit 770d1665011af0359aadb2175e9e3440e2effbf5)
2007-07-10 15:34:00 +10:00
Andrew Tridgell
3973b415be update lib/tdb from samba4
(This used to be ctdb commit 96a39ccee38bcfd64d614fe4670766e59ef246b6)
2007-07-10 15:32:27 +10:00
Andrew Tridgell
32de198fd3 update lib/replace from samba4
(This used to be ctdb commit f0555484105668c01c21f56322992e752e831109)
2007-07-10 15:29:31 +10:00
Andrew Tridgell
732353de5f - merged ctdb_store test from ronnie
- added DatabaseHashSize tunable
- added logging of events inside recovery (for timing)

(This used to be ctdb commit 3593cdb928b91e217faf1b3c537fa28dc82cdace)
2007-06-17 23:31:44 +10:00
Andrew Tridgell
14c788f3cb move more util code to lib/util
(This used to be ctdb commit de5ab0584c978a6be4afeacd80c84015b206a3c6)
2007-06-07 22:30:29 +10:00
Andrew Tridgell
69edd8e617 another place we need to cope with the strange epoll fork semantics
(This used to be ctdb commit cb1eeec15e61a7eb401e9e65306642343d5deb6e)
2007-06-02 10:01:17 +10:00
Andrew Tridgell
cc87648933 merge lib/replace from samba4
(This used to be ctdb commit d1a0bcbe331b05ad7a3f5f7a33e4c9b5242c43f2)
2007-05-30 18:06:57 +10:00
Andrew Tridgell
bc891232b6 fixed some debug messages
(This used to be ctdb commit 037f0149c0c0e65af0a1669b9a52586129e4b48f)
2007-05-29 13:48:30 +10:00
Andrew Tridgell
edf03e88c8 global lock should imply the transaction lock
(This used to be ctdb commit 765a7e27344476ea8835565839b69872ea6ab6f0)
2007-05-22 13:14:51 +10:00
Andrew Tridgell
13392414b1 nicer date formatting
(This used to be ctdb commit 78c256caa738593e335de65df752ff015f3a38e1)
2007-05-19 14:01:02 +10:00
Andrew Tridgell
2d9f0ee606 merge from samba4
(This used to be ctdb commit 3028a1b5c21b981c4487b55f026e6645bbeada89)
2007-05-18 11:24:45 +10:00
Andrew Tridgell
51f5bd2b31 merge from samba4
(This used to be ctdb commit b280bb01fc9afea5a9168c63d92907dac725b22b)
2007-05-18 08:33:10 +10:00
Andrew Tridgell
0b11bd99dd merged from samba4
(This used to be ctdb commit 23b1c00f8bf60739aee935bac44981b68477ee1f)
2007-05-17 17:54:02 +10:00
Andrew Tridgell
6d32a6dd50 merged debug changes from samba4
(This used to be ctdb commit f01180148635b9fcc0f50beddb87be0a2071dfd4)
2007-05-17 12:43:09 +10:00
Andrew Tridgell
241ce32f1d merged events changes from samba4
(This used to be ctdb commit cd9280556663bc8929672ada6ea556e097c4b2b3)
2007-05-17 12:39:53 +10:00
Andrew Tridgell
ae55e4181d added _mark calls for tdb_lockall
(This used to be ctdb commit e59134fd2af67c746b907c23fdcde2eccbbe17cf)
2007-05-12 14:33:10 +10:00
Andrew Tridgell
698d2a6af4 added nonblocking varients of the two lockall functions to tdb
(This used to be ctdb commit 2e99fa41ce01fa282bc0f3244ca42a78173743ed)
2007-05-10 17:43:08 +10:00
Andrew Tridgell
a3c70ac520 merge relevant lib code from samba4
(This used to be ctdb commit 8076a7c7e12da6d59bae31a2e4a0267d87c7b1b3)
2007-05-05 17:46:54 +10:00
Andrew Tridgell
3bfeb3d235 - added a EVENT_FD_AUTOCLOSE flag that allows you to tell the event system to close the fd automatically when a fd_event is freed. This prevents races which can lead to epoll missing events
- added autoconf rules for automatically building with epoll support

(This used to be ctdb commit 4d113298b26f7163992f2e47429c953bd4f957c9)
2007-05-05 17:17:25 +10:00
Andrew Tridgell
d903e9542d added tdb_chainlock_mark() call, which can be used to mark a chain locked without actually locking it. This will be used to guarantee forward progress in the ctdb non-blocking lockwait code
(This used to be ctdb commit 2af98c3418496b39106c7282f550049ec8239657)
2007-05-05 17:14:33 +10:00
Andrew Tridgell
fccc585f5a added seqnum propogation code to ctdb
(This used to be ctdb commit be2572b1b09eaaa1ea6a726d60f16996f9407d13)
2007-05-04 22:18:00 +10:00
Andrew Tridgell
6bc3758082 added a tdb_enable_seqnum() function
(This used to be ctdb commit 1f89da231c6637e339d5da156d6a48340706fe61)
2007-05-04 15:29:10 +10:00
Andrew Tridgell
6c114bb1bd enabled built in popt if system doesn't have it
(This used to be ctdb commit 30c8d69267a78e1d3dea0fcc936ee2939bb7a373)
2007-05-03 05:21:14 +10:00
Ronnie Sahlberg
599fa31266 update some calls to ctdb_control() that were still using the old
signature (flags field)

update some calls to ctdb_get_config() to use the new name 
ctdb_ctrl_get_config()

change #include "talloc/talloc.h" to #include "lib/talloc/talloc.h" in 
lib/events/events.h

(This used to be ctdb commit d2cdd87037b9f0c387228d7d4743da4869929c93)
2007-05-02 11:02:04 +10:00
Andrew Tridgell
e93b52a323 new files for updated events system
(This used to be ctdb commit 15d8308e5a0ce04351d70ac3dd25c7698931ebba)
2007-05-02 07:37:58 +10:00
Andrew Tridgell
169f129404 merge latest versions of lib/replace, lib/talloc, lib/tdb and lib/events into ctdb bzr tree
(This used to be ctdb commit eaea8a9fa8d2f5e08f3af619fa1008a663f39053)
2007-05-02 07:32:04 +10:00
Andrew Tridgell
3a05ad1402 fixed a lib/events bug found by volker
(This used to be ctdb commit 46cd984500cd77d295f059132b4892dbfbc2bcd3)
2007-05-02 06:50:12 +10:00
Andrew Tridgell
76381c4493 added make test and make valgrindtest targets
(This used to be ctdb commit b69fb43643993ee5aaabf8711bb874f95d468f35)
2007-04-28 10:57:58 +02:00
Peter Somogyi
9d521cf16a merged tridge's branch
(This used to be ctdb commit 02ec7d6abb75a7c0a414efd4a50d44e6f1e5e407)
2007-04-26 15:00:24 +02:00
Peter Somogyi
d244415d1e fixed ctdb/ib bug at reject event
reverted my suggestion in debug.c (based on my false error detection)

(This used to be ctdb commit 5c52c9f37639c65b551c10d1706c49653cd99742)
2007-04-23 12:45:14 +02:00
Andrew Tridgell
531f8237eb merge from samba4
(This used to be ctdb commit a64c6ace26559b2793f2a804430fb0fc53f03a34)
2007-04-21 10:09:37 +02:00
Andrew Tridgell
5afe9b709c merge tdb updates from samba4
(This used to be ctdb commit c9959e5741a17fd52070b744714eb00bf92a93eb)
2007-04-21 13:07:49 +10:00
Peter Somogyi
eb20281bb4 use talloc_vasprintf
(This used to be ctdb commit e259620d416497fba5ac43a87f3be7b280c21409)
2007-04-20 17:04:00 +02:00
Peter Somogyi
e5f2e5e5eb - ctdb/ib minor bugfixes (error case)
- make ctdb capable of alternative connection (like ib) again, solved the fork problem
- do_debug memory overwrite bugfix (occured using ibwrapper_test with wrong address given)

(This used to be ctdb commit da0b84cda26d544f63841dfd770ed7ebad401944)
2007-04-20 14:26:19 +02:00
Andrew Tridgell
8f059f4d91 - merge volkers debug changes
- fixed memory leaks in the 3 packet receive routines. The problem was
  that the ctdb_call logic would occasionally complete and free a
  incoming packet, which would then be freed again in the packet
  receive routine. The solution is to make the packet a child of a
  temporary context in the receive routine then free that temporary
  context. That allows other routines to keep or free the packet if
  they want to, while allowing us to safely free it (via a free of the
  temporary context) in the receive function

(This used to be ctdb commit 304aaaa7235febbe97ff9ecb43875b7265ac48cd)
2007-04-18 11:20:24 +10:00
Volker Lendecke
84d276a5be Some more debug and two memleak fixes
(This used to be ctdb commit 1e2802422794956827263265306952df5e69b377)
2007-04-17 23:03:30 +02:00
Volker Lendecke
3057f683f3 Add timestamps to debug output.
(This used to be ctdb commit 197a02384bd2ca42dfff4c0357175424d2321e9c)
2007-04-17 17:59:39 +02:00
Andrew Tridgell
7aa68f96f7 added a tdb_chainlock_nonblock() call to tdb
(This used to be ctdb commit 6587bdca71d97709c9271a73aea0be5a2a35f399)
2007-04-16 23:03:36 +10:00
Andrew Tridgell
8d2501e025 merge local copy of tdb from samba4 tdb
(This used to be ctdb commit d4619ce98ce44acaebeb6ae9c516a7917bf4e27f)
2007-04-16 22:52:58 +10:00
Andrew Tridgell
cc2696cc50 added rest of tdb (missed in earlier commit)
(This used to be ctdb commit 4c1434cc4613fc94958de0aa882bf7ca41ec8458)
2007-02-20 13:24:45 +11:00
Andrew Tridgell
e90f9aa084 merge db wrap code from samba4
(This used to be ctdb commit 2f3c299c76ce463cd866dfb1900ff45928f32ba6)
2007-01-25 15:11:36 +11:00
Andrew Tridgell
e1797cf6be added copies of libs so can be built standalone
(This used to be ctdb commit 0bf6e6cb371bb946ea8cc1d8c7a23a41ea715832)
2007-01-25 15:10:40 +11:00
Andrew Tridgell
fcae7fb9ca - added in idtree for efficient reqid handling
- started adding ctdb_call() code

- added ctdb_call_local() implementation

(This used to be ctdb commit 97b1fdf7fa0e230f36add3f1770ecb3a9faee0a1)
2006-11-28 20:48:34 +11:00
Andrew Tridgell
2b0530f51d get rid of some .svn files
(This used to be ctdb commit 43a7b5f1cf9d4aa46bf0f3b7857f0af5ada26b0b)
2006-11-18 11:00:52 +11:00
Andrew Tridgell
6613b7d438 initial version
(This used to be ctdb commit 5bba7deef9b03a68d336c138e83d6d4fac35bfce)
2006-11-18 10:41:20 +11:00