1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

420 Commits

Author SHA1 Message Date
Martin Schwenke
ad3c89095e Make 51_ctdb_bench.sh more tolerant.
Limit the allowable difference in message counts in either direction
around the ring to 5% (up from 2%).  There is something environmental
making this blow out to 3% very occasionally when there's no obvious
problem with ctdb.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit d6e6909ac629212b3028e13b958e1a17c64bee8c)
2009-06-10 16:15:09 +10:00
Sumit Bose
887046352d fix re pattern to accept the new recovery lock times in the statistics output
(This used to be ctdb commit ba44aae7307b4fa56f7b2da2cd9d4a7ccd0a135e)
2009-05-25 11:15:00 +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
Martin Schwenke
2a09b4bad3 In 51_ctdb_bench.sh now allows a 2% difference between positive and
negative.  ctdb_bench.c checks to ensure the timer has advanced from 0
before dividing.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 723413f246399b25166462d2018237920515655f)
2009-05-12 14:45:46 +10:00
Martin Schwenke
d59cd199e4 Avoid floating point divide by 0 in ctdb_fetch.c's bench_fetch().
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 3c67e164eb92591f8763883430490805c1dfa9ed)
2009-05-12 14:45:14 +10:00
Martin Schwenke
7c7c5b3489 Bug fixes for tests: simple/12_ctdb_getdebug.sh and scripts/test_wrap.
simple/12_ctdb_getdebug.sh now recognises output with multi-digit node
numbers.

Sharing the ctdb directory via NFS and testing on a real cluster by
setting CTDB_TEST_REAL_CLUSTER didn't work by default.  The fix is to
hack scripts/test_wrap so that it tries to find a valid bin directory
next to the directory containing it is in.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit ea2ca769e1d1068fbbad843750b19acfd87360e0)
2009-05-12 14:44:30 +10:00
Martin Schwenke
9666d7bf0a Use ctdb_fetch_lock rather than ctdb_call.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 5f3d2e29a446972ac244e20a08e48f4c2f4ffef4)
2009-05-12 08:55:36 +10:00
Andrew Tridgell
a0c86e4013 Merge commit 'ronnie/master'
(This used to be ctdb commit 1a110993af1706e0c5df500fa7d14e16c0668372)
2009-02-09 10:53:47 +11:00
Michael Adam
b183acf467 add a simple test script to test ctdb_check_tcp_ports
Michael

(This used to be ctdb commit 2634f1bd216ce18f061a282a53314cb1650dbd05)
2009-01-30 22:49:17 +01:00
Martin Schwenke
1b61a149f4 Make message in 62_ctdb_persistent_unsafe.sh more informative.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 4777b74b1e2eebe54cf27f3303f60e49023e7f6a)
2009-01-16 15:50:33 +11:00
Martin Schwenke
fc1f71ce0f 23_ctdb_moveip.sh sanity checks the list of IPs/nodes instead of
looping forever on older versions of CTDB.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 03dfcf9f284c9926479a8dd4e5acf1f5d2b964aa)
2009-01-16 15:12:40 +11:00
Martin Schwenke
7c6153e6aa Remove the sorts from 06_ctdb_getpid.sh - the PIDs should be listed in
node order.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 4b97bdba3bc4df20efb1aae7d89a1e3430d35ca3)
2009-01-13 17:02:59 +11:00
Martin Schwenke
5038a0d08a Use $CTDB_TEST_WRAPPER in other tests that need it.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 2912c1ade5db1e20bfa3a8017a702cc8a7da36f1)
2009-01-13 14:55:31 +11:00
Martin Schwenke
cb09075891 Use $CTDB_TEST_WRAPPER in 51_ctdb_bench.sh.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 44ec4c57bf9928ef5d5cc117a6c2d92495dac489)
2009-01-13 14:51:40 +11:00
Martin Schwenke
38593aa3e1 For now, make tests/run_tests.sh runs the new test suite. Add
tests/TODO.  Remove tests/start_daemons.sh - no longer used.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 5cdbef46b74e6a5ba2383ef025e69fe605fa4f6e)
2009-01-12 15:47:12 +11:00
Martin Schwenke
2e87ed4e9d Test binaries now go in tests/bin and ctdb_test_env now adds this
directory to $PATH if local daemons are being used.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a497010f67d6a8e68f4d6d7e516b88d2261b1062)
2009-01-09 18:15:06 +11:00
Martin Schwenke
91972a6bfc Add tests/README. ctdb_test_env and, therefore, run_tests can now be
run from the tests subdirectory... and most other sensible places.
Rename $CTDB_TEST_REMOTE_SCRIPTS_DIR to $CTDB_TEST_REMOTE_DIR since it
is now intented that this directory can contain test binaries too.
daemons_start() now passes a full path to the events.d directory when
starting ctdbd.  Also fixed the path to ctdbd.  41_ctdb_ban.sh and
42_ctdb_unban.sh fail immediately if they fail to select a test node.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 3ecce31d3a3f72b9fa851ac99291865c119e551e)
2009-01-09 17:52:38 +11:00
Martin Schwenke
a70327ce1a Delete some unstructured tests ({fetch,peristent,transaction}.sh) and
replace them with new simple tests (52_ctdb_fetch.sh,
53_ctdb_transaction.sh, 61_ctdb_persistent_safe.sh,
62_ctdb_persistent_unsafe.sh).  Remove "_simple" from some test
filenames in the simple subdirectory - that's redundant.  Always run
ctdb as $CTDB to allow $VALGRIND magic to be used.  Use pgrep/pkill to
detect/kill local daemons so those running under valgrind can be found
too - to support this, always run local daemons with the full path to
the executable.  run_tests now supports -s option to print sumamry
when done - with more and more tests, it is getting hard to follow
progress.  Sort the output of commands in 06_ctdb_getpid.sh to make
sure they compare nicely and also allow the processes' executables to
be called "memcheck" to catch those running under valgrind.  Remove
redundant calls to onnode in commands run from calls
try_command_on_node in some tests.  41_ctdb_ban.sh and
42_ctdb_unban.sh avoid banning the recmaster, since this causes the
recmaster to be reassigned and all nodes to be unbanned.  Minor
cleanups.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 33cdf3e4bcfadf8e20822ca352babf7acca16821)
2009-01-08 17:12:03 +11:00
Martin Schwenke
6ad847b9ac Remove old ctdbd.sh test script. Remove unneeded nodes.txt and
public_addresses files - these are now created in tests/var as needed.
09_ctdb_ping.sh now recognises new "node disconnected" message.
Replace custom recovery detection code (which could not have been
working) with a call to "ctdb recover" in 32_ctdb_enable_simple.sh.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 486ed3b5b483f1c12c2d978ec6564bd33a2c6aee)
2008-12-18 14:25:07 +11:00
Martin Schwenke
c572c11d3a Remove bench.sh test and replace with new test 51_ctdb_bench.sh.
Function try_command_on_node node passes any options other than -v to
onnode.  Minor update to 14_ctdb_statistics.sh.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit e627f8e5fe8e2e3ea423b7dbd12d74597fb4983b)
2008-12-18 11:28:43 +11:00
Martin Schwenke
fae7e15114 Bug fixes for ctdb_bench from Ronnie.
(This used to be ctdb commit 2c055831f0d56e42d055e1d72fb6f0db5f71def1)
2008-12-18 09:45:49 +11:00
Martin Schwenke
12c16dd9b0 ctdb_test_env now sets $CTDB_TIMEOUT. Fixed
26_ctdb_config_check_error_on_unreachable_ctdb.sh to work with new
generic error message when trying to talk to disconnected node.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 33afe9bae732e62994e5957ee143a9c49571898b)
2008-12-17 16:59:23 +11:00
Martin Schwenke
a6fb2c35b4 New test 26_ctdb_config_check_error_on_unreachable_ctdb.sh.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a99204ad8bd4d3b15c8219762442682a3d1285cf)
2008-12-17 15:04:35 +11:00
Martin Schwenke
331f39d340 Finish 24_ctdb_getdbmap.sh. New test 25_dumpmemory.sh.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit f5aeab0390b735291ee82359f50d508619211623)
2008-12-16 17:22:22 +11:00
Martin Schwenke
b3dbc3f3aa 3 new tests. 24_ctdb_getdbmap.sh is only 1/2 implemented but does
something vaguely useful.  ctdb_test_exit unsets $ctdb_test_exit_hook.
Fix bug in 17_ctdb_config_delete_ip.sh.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit f90f6e19952d58b8590fe550ecf2308bd9b065dc)
2008-12-15 17:52:12 +11:00
Martin Schwenke
3e1e589e58 Add a recovery to ctdb_test_exit to improve test stability.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit b7be3de004cb05dad05704096e2a75e128952b18)
2008-12-12 18:44:21 +11:00
Martin Schwenke
6c6fd47528 Rename $CTDB_NUM_NODES to $CTDB_TEST_NUM_DAEMONS and only set it if
$CTDB_TEST_REAL_CLUSTER is not set.  After a ctdb restart, force a
recovery to attempt to help tests that follows.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 497c40f69e06776861a780500da1952eb7ea8fc1)
2008-12-12 17:25:38 +11:00
Martin Schwenke
0d2c4e181e Add message about restart to 18_ctdb_freeze.sh.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 2a069118fee169460bdf68b9a639b0e96ac85266)
2008-12-11 18:14:17 +11:00
Martin Schwenke
ceefb6a029 With local daemons the sockets are now numbered starting from 0. Fix
setup of local daemons so that it correctly assigns no public IPs to a
single node each time.  Separate out daemon_setup so that the
selection of the node with no public IPs is only done once at the
beginning of testing.  Clean up all current tests, mostly with a view
to ensuring that a node selected for testing some kind of failover
actually has public addresses assigned.  Reenabled 01_ctdb_version.sh
- it now passes if rpm doesn't do anything useful on the node.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 86807e8b7b179cbe87e559fb3b1f02c8b1990dc4)
2008-12-10 16:13:42 +11:00
Martin Schwenke
60f86400ac Added use of $ctdb_test_exit_hook to function ctdb_test_exit. Removed
sleeps from ban/unban tests.  Now expect "ctdb ping" to return false
if it fails, so made relevant change to 09_ctdb_ping.sh.  New
functions install_eventscript and uninstall_eventscript.  New
setup/cleanup tests 00_ctdb_install_eventscript.sh and
99_ctdb_uninstall_eventscript.sh.  New test 21_ctdb_disablemonitor.sh,
which is incredibly complex.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 23bffef2295772f5b795236d60b7fb6ea754b7fb)
2008-12-09 18:20:11 +11:00
Martin Schwenke
c9ca8ccc23 When running with local daemons, provided there is more than 2 of
them, randomly pick a single node that will not have any public IPs
assigned.  This will make life a bit more interesting and will
simulate what happens on real clusters with a management node.  Some
tests were disabling a node to implicitly trigger a ctdb restart - now
use an explicit restart of ctdb when it is required.
17_ctdb_config_delete_ip.sh now randomly chooses a public IP on any
node to disable - this works around a problem where the hardcoded node
might not have any public addresses.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 3d59783c0e9478f4766c380945d6200fc654f5d9)
2008-12-08 08:15:18 +11:00
Martin Schwenke
805c5bf1f3 New test for getmonmode. Overload node_has_status some more to
support checking the monitoring mode.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 4e1c079deb0aafb99d4114bb6504ff5ba1cbdeb4)
2008-12-04 17:19:51 +11:00
Martin Schwenke
9a4f7e4f4c ctdb_test_init now contains a trap to force ctdb_test_exit to be run
if the shell exits and ctdb_test_exit cancels this trap.  This means
that a testcase executing under set -e will call ctdb_test_exit on
failure, allowing the cluster to be restarted if necessary so that
following tests can complete successfully.  ctdb_test_exit now
respects $?, so a test will fail if the last thing executed before
ctdb_test_exit failed - this probably means the above trap was
triggered.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 805a426aaee5ecfc5bd1c097069fe58f8241dfe2)
2008-12-03 18:08:21 +11:00
Martin Schwenke
3cdc0cb708 $PATH only inludes $CTDB_DIR/bin if we're using local sockets. Rename
$TEST_WRAP to $CTDB_TEST_WRAPPER - value now set using
$CTDB_TEST_REMOTE_SCRIPTS_DIR if that is set.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a69545d7dec78eefb85a1598e5db4667cc210bf9)
2008-12-03 15:48:24 +11:00
Martin Schwenke
a04094659c 4 new tests. Hacked function node_has_status to support
frozen/unfrozen via ctdb statistics command.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit e040a989096cf7d5c0cdece1713ff903cb7568f8)
2008-11-27 18:11:22 +11:00
Martin Schwenke
0b6da4f7ec 4 new tests. Marked more ctdbd.sh tests as done - will remove this
file soon.  Simplify 06_ctdb_getpid.sh by using -v option to
try_command_on_node.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit c6fc68db9061547e73ec2b811e260bd7da7f58fa)
2008-11-25 17:53:28 +11:00
Martin Schwenke
5d50f5a91c New test 09_ctdb_ping.sh. Add documentation and command-line
processing to all tests.  New script ctdb_test_env sets up environment
for tests, is now sourced by run_tests, and can also take a test on
the command-line, complete with options.  Various cleanups and
improvements.  Document tests that have been properly implemented in
ctdbd.sh.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 826e85fe5291067b8d0b9c22918d63024aa6141c)
2008-11-24 17:47:09 +11:00
Martin Schwenke
734f3ada52 Move tests/*.c to tests/src/*.c and adjust Makefile.in accordingly.
Move setting of $CTDB_NODES_SOCKETS to tests/scripts/run_tests and
make it only happen if $CTDB_TEST_REAL_CLUSTER is not set.  Bugfix in
function ips_are_on_nodeglob.  New/proper implementations of functions
stop_daemons and start_daemons, now called by function restart_ctdb.
In start_daemons.sh, add public addresses file generation/usage, use
new option --nopublicipcheck to ctdbd to avoid crazy behaviour and
kill ctdbd more carefully to avoid killing real daemons on a real
cluster - this should be able to coexist on a node of a real cluster.
start_daemons.sh is temporarily incompatible with start_daemons
function, but expecting to replace that script with function calls
very soon anyway...

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 4c54772c5c2fa7d2a25963379b5b96caf0c2521c)
2008-11-21 19:01:48 +11:00
Martin Schwenke
d741559fa6 Add some simple tests that can be run from within the tree.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit eacb2ef82ea4809d874158756db973dd1e3fc8fc)
2008-11-20 20:40:01 +11:00
Ronnie Sahlberg
07d35c754f add a CTDB_SOCKET variable that can be used to override the default
/tmp/ctdb.socket

(This used to be ctdb commit b75e2263c565c21ecbbd98fbd2c10787e467bf5c)
2008-11-11 14:49:30 +11:00
Ronnie Sahlberg
d83fc7e389 when we collect all ip addresses and sort them for the "ctdb ip -n all" output we must look at more than just the first 4 bytes of the sockaddr address or ipv6 wont work
(This used to be ctdb commit 4dfbfb4618433d9ed79ca1bdb1e2e51d96d4ee62)
2008-08-22 09:09:08 +10:00
Ronnie Sahlberg
37234887d9 fix the ipv6 checksum calculation for pseudoheader so that it actually works
add support to send ipv6 "gratious arp" aka neighbor solicitation packets from ctdb

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>

(This used to be ctdb commit 0a38ea11af9237501f2951fee698a59b46f8750d)
2008-08-19 18:24:08 +10:00
Ronnie Sahlberg
342408d75e remove a file we dont need
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>

(This used to be ctdb commit bf6effef0cc9e5f2eeeb38fce855a90624a76239)
2008-08-19 14:58:57 +10:00
Ronnie Sahlberg
ef997d344f initial ipv6 patch
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>

(This used to be ctdb commit 1f131f21386f428bbbbb29098d56c2f64596583b)
2008-08-19 14:58:29 +10:00
Andrew Tridgell
ae2b9ee17f fixed some warnings
(This used to be ctdb commit fe55bfc8fb6dc628f72f220843e829a251d09936)
2008-07-30 19:59:54 +10:00
Andrew Tridgell
446295f257 fixed a warning
(This used to be ctdb commit 3a71844cfdb9fe69208030432ddb547b0e215726)
2008-07-30 19:59:42 +10:00
Andrew Tridgell
5e969d7a6c cleanup of the old persistent db test
(This used to be ctdb commit 306af4ccef132ea023f1f01e11f877a3a742ee4c)
2008-07-30 19:59:34 +10:00
Andrew Tridgell
bc1aed395c added a new persistent transaction test program
(This used to be ctdb commit d5dcb46e182466e4b51c106f2491178c23babd8d)
2008-07-30 19:55:54 +10:00
Andrew Tridgell
bf32a8e6c3 cleanup on SIGINT
(This used to be ctdb commit 008533d971aec9c28c6e4750ef4677dd943633ff)
2008-07-30 13:21:02 +10:00
Andrew Tridgell
b7e9d0dccf - cleanup persistent db at start
- catch SIGINT and kill daemons

(This used to be ctdb commit d3f5d75665a78ae0081fda57e58384b27a6ae396)
2008-07-30 13:20:47 +10:00
Andrew Tridgell
9c10147fc1 - show pids during test
- don't use first_time, as it is not safe for multiple 
  clients on a node

(This used to be ctdb commit 22f737be0e70fc043affaa4f953f60d852b7999a)
2008-07-30 13:20:24 +10:00
Ronnie Sahlberg
1c88f422d5 add a parameter for the tdb-flags to the client function
ctdb_attach()   so that we can pass TDB_NOSYNC when we attach to
a persistent database and want fast unsafe writes instead of
slow but safe tdb_transaction writes.

enhance the ctdb_persistent test suite to test both safe and unsafe writes

(This used to be ctdb commit 4948574f5a290434f3edd0c052cf13f3645deec4)
2008-06-04 10:46:20 +10:00
Ronnie Sahlberg
a594ac1e91 run the persistent write test with 4 nodes by default
use the timelimit argument to the persistent writer to run the test for
30 seconds by default

(This used to be ctdb commit 181318fea6886c40d0aff02d0de777f28ffeddce)
2008-06-03 18:19:48 +10:00
Ronnie Sahlberg
fba38a5325 redesign the test of persistent writes
so that we have n persistent writers on n nodes,
all writers writing persistently to the same record.

each writer on a node has its own "counter" in this record that is incremented by one in each iteration.
the persistent writer on node 0 also checks that all the counters in the record are increasing monotonically and if they are not, flagging it as an ERROR.

(This used to be ctdb commit 00006222ece63ae3b7f3477646232ae5bbeee6f4)
2008-06-03 18:18:28 +10:00
Ronnie Sahlberg
a8cf6e7914 create the nodes file in a 'test' subdirectory and not the current directory
delete all persistent databases when the test starts
(the tests only uses test databases in a special test directory)

do not set up any public addresses in the tests

wait until there are no disconnected or unhealthy nodes when starting the
test daemons instead of waiting for the recovery mode to change.
we do want to wait until the system has recovered and ALL nodes are ok.

(This used to be ctdb commit dfe0c44c1e8e9dab790686c5ba798986d04bf218)
2008-06-03 18:14:54 +10:00
Andrew Tridgell
f6e53f433b merge from ronnie
(This used to be ctdb commit e7b57d38cf7255be823a223cf15b7526285b4f1c)
2008-02-04 20:07:15 +11:00
Andrew Tridgell
146d4b0db7 merge async recovery changes from Ronnie
(This used to be ctdb commit 576e317640d25f8059114f15c6f1ebcee5e5b6e2)
2008-01-29 13:59:28 +11:00
Andrew Tridgell
3777346629 partial merge from ronnie
(This used to be ctdb commit fd316deb8a9e0545c8efa1bfc8ad83962b310405)
2008-01-29 11:39:06 +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
fae327d471 report the store rate in ctdb_randrec
(This used to be ctdb commit da3fb053d91da76122b12f0efb1d31e085b59574)
2008-01-09 17:45:13 +11:00
Andrew Tridgell
5b6486c35b allow delete percentage to be specified on the command line
(This used to be ctdb commit 1177b48067a92cbf013e19027d4122327c620361)
2008-01-09 15:32:18 +11:00
Andrew Tridgell
10bc8a4c92 added ctdb_randrec test tool
(This used to be ctdb commit be59e7f3db992667664a631433b99ff19f4313f0)
2008-01-04 09:41:04 +11:00
Andrew Tridgell
bb06e831a0 more optimisations to recovery
(This used to be ctdb commit 9a41ad0a842cd4f3792d6e84b5c809b7ff6f342e)
2008-01-02 22:44:46 +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
4608fcc3a4 need public_addresses for test suite
(This used to be ctdb commit 6d79994eace4802ab72dda2793028264c47d2d56)
2007-11-18 15:01:26 +11:00
Andrew Tridgell
0943fba979 make it easier to test starting large numbers of virtual nodes
(This used to be ctdb commit cf61bf8b8806d29772985c904d5ee15c24d4d767)
2007-11-13 10:28:06 +11:00
Andrew Tridgell
b87ddd9148 no longer wait at startup for services to become available, instead
set the node initially unhealthy and let the status monitoring bring the node online.
This fixes a problem with winbindd, where it refused to start because secrets.tdb was not populated
but we could not populate ctdbd, because the net command would not run while ctdbd was still doing startup
and thus frozen
(This used to be ctdb commit 3a001b793dd76fb96addf1e2ccb74da326fbcfbc)
2007-09-24 10:00:14 +10:00
Andrew Tridgell
c60988325d added support for persistent databases in ctdbd
(This used to be ctdb commit 3115090a0d882beca9d70761130b74bb0821f201)
2007-09-21 12:24:02 +10:00
Ronnie Sahlberg
583b6e6ba6 change ctdb_get_vnn to ctdb_get_pnn
(This used to be ctdb commit 1e19930198c2bcc7ccb755e0ee51555fb823029a)
2007-09-04 10:18:44 +10:00
Ronnie Sahlberg
8fd3df2553 hang the ctdb_req_control structure off the ctdb_client_control_state
struct  so that if we timeout a control we can print debug info such as 
what opcode failed and to which node

we dont need the *status parameter to ctdb_client_control_state

create async versions of the getrecmaster control

pass a memory context to getrecmaster

(This used to be ctdb commit 558b680c82f830fba82c283c78c2de8a0b150b75)
2007-08-23 13:00:10 +10:00
Andrew Tridgell
95f6328678 merge from volker
(This used to be ctdb commit 7007e4f2292aa96287b899d6b9e82c7b597ef58f)
2007-08-22 17:16:01 +10:00
Andrew Tridgell
46639ac19e merged new event script calling code from ronnnie
(This used to be ctdb commit bbacad61b3eee4276ffe44ed2a23949aca8152cf)
2007-08-20 11:10:30 +10:00
Andrew Tridgell
f2fb717402 merge from ronnie
(This used to be ctdb commit 0a91fe52f34d997c1a3cde0fa356deaaf290a4a9)
2007-08-15 11:48:03 +10:00
Ronnie Sahlberg
e0957ba4a4 add a function to return the first entry that is stored in a tree where
the key is an array of uint32_t

(This used to be ctdb commit 99553397aade4f1c4d17ef14dad406934958c80a)
2007-08-15 10:57:21 +10:00
Ronnie Sahlberg
9c6e37fea4 enhanced tests to verify the tree integrity when adding/removing nodes
(This used to be ctdb commit 7885a4fa6e4ac50081e440ed6c82101ec807999f)
2007-08-13 14:29:19 +10:00
Ronnie Sahlberg
a405cc32d9 remove an extra blankline
(This used to be ctdb commit c71f237e384b33e3c560af3329c615bda613ca04)
2007-08-09 16:11:11 +10:00
Ronnie Sahlberg
adb49f02f0 change the mem hierarchy for trees. let the node be owned by the data
we store in the tree and use a node destructor so that when the data is 
talloc_free()d we also remove the node from the tree.

(This used to be ctdb commit b8dabd1811ebd85ee031563e95085f720a2fa04d)
2007-08-09 14:08:59 +10:00
Ronnie Sahlberg
5332b61c4f run the test for 60 seconds if that is what we claim
(This used to be ctdb commit ff0c0526e21c35fe7a599e61cd0f84352c7f6ad6)
2007-08-08 17:49:08 +10:00
Ronnie Sahlberg
22e8064ae9 add more extensive test cases and verify that we are not losing any
memory inside the tree

(This used to be ctdb commit 838376b52d65af509532a141d83b51975c7cc881)
2007-08-08 17:26:40 +10:00
Ronnie Sahlberg
203306400e add helpers to traverse a tree where the key is an array of uint32
(This used to be ctdb commit d328c66827cafff6356e96df2a782930274fe139)
2007-08-08 13:50:18 +10:00
Ronnie Sahlberg
9525b010aa add helpers to add/lookup/delete nodes in a tree where the key is an
array of uint32

(This used to be ctdb commit b7e0996e7735c8629d07453b9d335990c2dbc3db)
2007-08-08 12:30:12 +10:00
Ronnie Sahlberg
c1bfda5772 add a tree insert function that takes a callback fucntion to populate
the data of the tree.
this callback makes it more convenient to manage cases where one might 
want to insert multiple entries into the tree with the same key

rename the tree->tree pointer to tree->root  since this is supposed to 
point to the root of the tree

add a small test utility

(This used to be ctdb commit f6313bed9c53e0d1c36c9e08ac707e88e2a4fcd5)
2007-08-08 11:21:18 +10:00
Ronnie Sahlberg
64f61364a7 add a small tool to compare rb tree with a timeval_compare()+add an
entry to the end of the list DLIST (worst case insert)

(This used to be ctdb commit dcdf4a1f1c6675ae11ab26726c867d7782954fc6)
2007-07-30 10:50:35 +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
Ronnie Sahlberg
cddf988961 add a small test tool that can be used to create a massive amount of
records in the test database.

the tool first creates the number of records requested, then it will 
loop infinitely reading the records out again.

(This used to be ctdb commit dca2497097a9cdff268b1e5d446f6feb71bfb389)
2007-06-17 11:13:42 +10:00
Andrew Tridgell
2b91099585 support up takeover in testing when root
(This used to be ctdb commit df409156e685373ea98986511149c9fba3a8c812)
2007-06-09 21:47:06 +10:00
Andrew Tridgell
b50096c835 more code rearrangement
(This used to be ctdb commit 2bcf3b16163041f03add2e5bf9f1f5fb3599ec24)
2007-06-07 22:16:48 +10:00
Andrew Tridgell
2ed57a9ae1 implement a scheme where nodes are banned if they continuously caused the cluster
to start a recovery session. The node is banned from the cluster for the RecoveryBanPeriod (default of 5 minutes)

(This used to be ctdb commit 4ad43dd07f526b6002477177fbf55483246c2c0c)
2007-06-07 15:18:55 +10:00
Andrew Tridgell
cafddf76dc - fixed flags display in logs
- added monitor handler to test event script

(This used to be ctdb commit a4c18dddee169df49e5d77d9a94ce9329f169319)
2007-06-06 11:13:24 +10:00
Andrew Tridgell
dbb2ec43dd added tunables settable using ctdb command line tool
(This used to be ctdb commit 73d440f8cb19373cfad7a2f0f0ca4f963c57ff29)
2007-06-04 19:53:19 +10:00
Andrew Tridgell
f1d81386e6 - start moving tunable variables into their own structure
- fixed the test scripts to use a separate dbdir

(This used to be ctdb commit 396752e8908c48373564e915e2d49cfc9ff61eba)
2007-06-04 17:46:37 +10:00
Andrew Tridgell
a57991c0eb remove some cruft thats not needed any more
(This used to be ctdb commit c4308805b997740b77e058c1a14b84cb400a7c30)
2007-06-04 17:23:55 +10:00
Andrew Tridgell
90158f7ad7 removed some old cruft
(This used to be ctdb commit 44040d5ecabcd32ee26c0285e3786dfb9b4f8126)
2007-06-02 19:23:48 +10:00
Andrew Tridgell
c5e4ce360a make test now works again
(This used to be ctdb commit 439d87bbb9840f82937e51aff4fe2b80160878c6)
2007-06-02 13:31:36 +10:00
Andrew Tridgell
68963d865a first step towards fixing "make test" with the new daemon system
(This used to be ctdb commit f95f7e4c93dea482e6cf0614b5415229a7c9f3fb)
2007-06-02 13:16:11 +10:00
Andrew Tridgell
ebf12646cf - make specification of a recovery lock file compulsory
- die if someone other than the recmaster can get the recovery lock

(This used to be ctdb commit a827d0d0e430ca8ad5d521367e45097185492869)
2007-06-02 11:36:42 +10:00
Andrew Tridgell
b5890ad2c1 split out events for each subsystem separately
(This used to be ctdb commit 03c629a72f234dcc783fa1085e7edba09597c241)
2007-06-01 20:54:26 +10:00
Andrew Tridgell
869d70d9c9 convert ctdbd.sh tests to use an event script
(This used to be ctdb commit b3eff804fe59238ed37cd692cc04785089a89dc3)
2007-06-01 19:04:51 +10:00
Andrew Tridgell
bf3b740a1b ctdb is GPL not LGPL
(This used to be ctdb commit 8624378010d1c2a1438e1e701339dfba7276f960)
2007-05-31 13:50:53 +10:00
Andrew Tridgell
2d9e0ad56a use /etc/services for ctdb
(This used to be ctdb commit 64bf6964ff33320c5351337c7f8ed4da5bd71275)
2007-05-29 15:15:00 +10:00
Andrew Tridgell
ccf4d78e04 - renamed ctdb_control utility to ctdb
- use -n to specify node number in ctdb utility

- change 'ctdb status' to 'ctdb statistics'

- added 'ctdb status' which shows status

- added netmask to public IPs, so you don't try a takeover on a
  foreign network

- cleaned up tools/ctdb_control.c a lot

- generate usage message at runtime

(This used to be ctdb commit 28de71c03ace7d32a9fd9882fabbd5d668b97656)
2007-05-29 12:16:59 +10:00
Andrew Tridgell
a5198559c9 moved the recovery daemon into the main ctdbd and enable it by default
(This used to be ctdb commit 2a7d42124731f43d013cb76a798525eab4cc1ee0)
2007-05-15 15:13:36 +10:00
Andrew Tridgell
682df74d59 separate the wire format and internal format for the vnn_map
(This used to be ctdb commit 9a71718d87c5162f1423d85c2e86a01f6771925e)
2007-05-10 08:13:19 +10:00
Ronnie Sahlberg
6929739b7f add a command line flag to ctdbd to start a recovery daemon.
update the recovery test script to start all ctdb daemons with a 
recovery daemon

(This used to be ctdb commit 47794e16df285cacefc30208d892d931a6e46b96)
2007-05-09 09:59:23 +10:00
Ronnie Sahlberg
c6bd23ee11 update to rhe recovery daemon
ctdb_ctrl_ calls are timedout due to nodes arriving or leaving the 
cluster it crashes the recovery daemon afterwards with a SEGV but no 
useful stack backtrace

(This used to be ctdb commit cd3abc7349e86555ccd87cd47a1dcc2adad2f46c)
2007-05-06 06:58:01 +10:00
Ronnie Sahlberg
60d4b0e8b4 in the recover test
start the daemons with explicit socketnames and explicit ip address/port

remove all --socket=  from all ctdb_control calls since they are not 
needed anymore

(This used to be ctdb commit 593a959d428f5b4a913117a9b5c8fe65a3eb950e)
2007-05-06 06:06:39 +10:00
Ronnie Sahlberg
7bbcc964f2 add support in catdb to dump the content of a specific nodes tdb instead
of traversing the full cluster.
this makes it easier to debug recovery

update the test script for recovery to reflect the newish signatures to
ctdb_control



the catdb control does still segfault however when there are missing 
nodes in the cluster   as there are toward the end of the recovery test

(This used to be ctdb commit 8de2a97c14a444f817ceb36461314f10c9601ecc)
2007-05-06 05:53:15 +10:00
Ronnie Sahlberg
25edbc9a50 add a control to get the pid of a daemon.
this makes it possible to kill a specific daemon in the recover test 
script

(This used to be ctdb commit 2fa394b4c80988cb1a6d04b236ec64cc9d9e8a40)
2007-05-06 04:31:22 +10:00
Ronnie Sahlberg
508cafd17e merge from tridge
(This used to be ctdb commit 6c8b90cedc67daa89d54db5268fde18bfc20abaf)
2007-05-04 17:05:28 +10:00
Ronnie Sahlberg
418cb36d32 remove a exit from the test script
(This used to be ctdb commit 4adb61f8270dbd15732bc458d49a66138dd240cc)
2007-05-04 15:25:57 +10:00
Ronnie Sahlberg
7dfdab1b9d recovery daemon
this program is a client to the local ctdb daemon

every second it pulls all vnnmap and nodemaps from all nodes that are 
available and checks if a recovery is required

a recovery is required if :
* all nodes do NOT have an identical vnnmap and generation
* all nodes do NOT have an identical nodemap
* there are active nodes that are NOT in the nodemap
* there are nodes in the nodemap that are NOT active

During recovery,  the recovery tool will also make sure that all nodes 
know about and have created all databases.

(This used to be ctdb commit 2f2650467bac7e8954de7c17cb34f46b0bdbcd26)
2007-05-04 15:21:40 +10:00
Andrew Tridgell
f2fd53056d nicer interface to ctdb traverse
(This used to be ctdb commit e5ce866dcc5037b5069e42bf1e168b646f007b01)
2007-05-04 12:18:39 +10:00
Andrew Tridgell
e752f3bd97 - changed the REQ_REGISTER PDU to be a control
- allow controls to know which client invoked them

- added a client_id to clients, so they can be identified remotely

- added the ability to remove registered srvids

- in the list_keys code, register a temp srvid, then remove it afterwards

(This used to be ctdb commit 29603c51cc6d81362532cd8e50f75c8360c5f5ef)
2007-05-04 11:41:29 +10:00
Andrew Tridgell
648e3835b3 merge from ronnie
(This used to be ctdb commit cf23175526d8fde1ef145605fb545584384b6cec)
2007-05-04 10:43:39 +10:00
Andrew Tridgell
60b42276eb first version of traverse is working
(This used to be ctdb commit ecac90cee389a6fa0e9b1efba521e098a24d323f)
2007-05-03 17:12:23 +10:00
Ronnie Sahlberg
fe24692d46 do a real recovery by killing a node and then calling the recover
control

(This used to be ctdb commit f8d97f8b56f0af83a514ec0364eb915e2d5ea2d7)
2007-05-02 21:31:20 +10:00
Ronnie Sahlberg
97504b62e2 recover.sh test script that build a few database and populates them with
a record  then performs a recovery which merges all records onto node 0

(This used to be ctdb commit 54a072deb40d8d4a4a9e35bfde0eec3c867211d0)
2007-05-02 21:14:37 +10:00
Ronnie Sahlberg
206fb1fd3b add a recover test change alignment for the pull/push db structures
(This used to be ctdb commit 0eb45623ca103e69765ed577ae02e7f8ca777e37)
2007-05-02 21:00:02 +10:00
Ronnie Sahlberg
c06c1e1f9f remove sleep from the fetch test
add a test script to start 4 daemons to test recovery

(This used to be ctdb commit 09eab12b00934afa5159fc500faf6b07effb2804)
2007-05-02 13:14:12 +10:00
Ronnie Sahlberg
d20990c2b6 add a control to create a database
(This used to be ctdb commit 74e489c6737cc79537c7812ea82daafb1b363ec2)
2007-05-02 12:43:35 +10:00
Ronnie Sahlberg
1f84807005 remove test code in the fetch test to keep the daemons running forever
(so one has lots of tiume to play with ctdb_control)

(This used to be ctdb commit 8fbaf82a7b3f0e62c887e91731ad8c659122c785)
2007-05-02 11:09:10 +10:00
Ronnie Sahlberg
3a891c6676 merge with tridges tree to resolve all conflicts
(This used to be ctdb commit 0f7c6c580ef0de60af68fd22bce36c0c0b2515b0)
2007-05-02 10:53:29 +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
5b8c4bba5a auto-determine listen address by attempting to bind to each address in the cluster in turn
(This used to be ctdb commit 2fab9f96df2e5b5c51c860fd65caf0e926a63e34)
2007-05-01 06:34:55 +10:00
Andrew Tridgell
bbf358cfcf added attach command in ctdb_control
(This used to be ctdb commit 172ee33306be2ef5ce17a5b9d7fbcc1f265a1b0b)
2007-04-30 15:54:06 +02:00
Andrew Tridgell
9366120d92 changed the way set_call and attach are done so that you can safely
attach to databases after the protocol has started. The daemon
broadcasts information on new databases to the other daemons.

This also eliminates the need for the client to know about the hash
between db name and db_id.

(This used to be ctdb commit 3bad91a9d987d4c09fe3322eac23c2733660ad08)
2007-04-30 15:31:40 +02:00
Andrew Tridgell
f455d3f44b saner logfile code
testing of ctdbd

(This used to be ctdb commit 05789da5818f8b20f04779b0df5125914d9047f6)
2007-04-29 22:42:23 +02:00
Ronnie Sahlberg
eacfcaf437 add push/pull of tdb and a control to copy a tdb from one node to
another node

(This used to be ctdb commit c313daff4c1362cd08a9f682ce04cab312678038)
2007-04-30 00:58:27 +10:00
Ronnie Sahlberg
f67a79ad8e merge from tridge
(This used to be ctdb commit a84e9b47a87fc7d4756b4a179aa2ea0bc7c54c78)
2007-04-29 23:49:27 +10:00
Ronnie Sahlberg
097037a055 add a control to read an entire tdb from a node including
key/lmaster/header and data

(This used to be ctdb commit ac00d6271ba6356c1edf804df44d0d2600791610)
2007-04-29 05:47:13 +10:00
Andrew Tridgell
6e09bfdaf9 much simpler redirect logic
(This used to be ctdb commit 95db9afa7dd039e1700e2f3078782f6ac66e9f51)
2007-04-28 18:18:33 +02:00
Ronnie Sahlberg
d81b306b93 merge with tridge
fix the logic in ctdb_connected to print CONNECTED if the node is 
connected and UNAVAILABLE when the node is dead  instead of the opposite

(This used to be ctdb commit 0f431d2f3e0bd94d10fe77e56cf0ed6c48402400)
2007-04-28 23:11:23 +10:00
Andrew Tridgell
2e77ee8f4d merged from ronnie
(This used to be ctdb commit 521484a462dcddeebe02bb9c725e18939919b6fe)
2007-04-28 13:02:59 +02:00
Ronnie Sahlberg
643bfe83d3 add a control to pull the database list from a remote node
(This used to be ctdb commit d130e02936ea4bdcd3a6f02c53be4b7771993138)
2007-04-28 20:00:50 +10:00
Andrew Tridgell
ee228e870d fixed some warnings
(This used to be ctdb commit b5434a40cf2db008eb1e681fcd2ceeff331324fa)
2007-04-28 11:35:49 +02: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
Ronnie Sahlberg
5b4ebe1345 make srvid 64 bits instead of 32 bits
(This used to be ctdb commit 723bcfbba1d5aa711496d37b9658190b78a2d66b)
2007-04-28 00:31:45 +10:00
Andrew Tridgell
f0a582e454 got rid of the getdbpath call
(This used to be ctdb commit 736ce5c00a1d1b47abb44c4b262b14bfba5202b1)
2007-04-26 23:10:35 +02:00
Peter Somogyi
9d521cf16a merged tridge's branch
(This used to be ctdb commit 02ec7d6abb75a7c0a414efd4a50d44e6f1e5e407)
2007-04-26 15:00:24 +02:00
Andrew Tridgell
d955485e7b added a ctdb control message, and tool
(This used to be ctdb commit 0d7a71f35bb8ce95231f8ca1e8e3e4024fe657e5)
2007-04-26 14:27:49 +02:00
Ronnie Sahlberg
dabf61075f add pdu's that the client can use to query the ctdb daemon of the path
to the database it created (so the client can open and access the same 
file)

(This used to be ctdb commit c2eda19499b3263b2248c41bd531fb73c7b42212)
2007-04-24 00:06:48 +10: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
eeb3f01e02 merge from ronnie
remove unused bench_incr function in ctdb_bench.c

(This used to be ctdb commit 39424cb13070c9964121b533a9f9ba448ce49d16)
2007-04-19 12:43:19 +10:00
Andrew Tridgell
d0af75d1fa - fully separate the client version of ctdb_call from the daemon
version. The client version is different enough that this is
  worthwhile

- enable local shortcut for client version of ctdb_call

- add idr_find_type(), with better error reporting in case of type
  mismatch

(This used to be ctdb commit 2388094c5f7b6ce003e86b05620c06217d63b49c)
2007-04-19 11:28:01 +10:00
Andrew Tridgell
0029883c0b use shutdown in more tests
(This used to be ctdb commit 150153947b959f90991fdae8d7c85ef8d551dff5)
2007-04-18 15:27:38 +10:00
Andrew Tridgell
a4bbc88cf1 - merge from ronnie, and use wait instead of sleep in test scripts
(This used to be ctdb commit 6e6812641e3ce7afae7bd46ed317a885839fdd4f)
2007-04-18 14:42:02 +10:00
Ronnie sahlberg
adb4becfb7 add/finish the ctdb_shutdown() function.
this function can be used in test applications to perform an orderly shutdown of the ctdb cluster once the test has completed.
the ctdb nodes will remain operational until all of them have received a shutdown from their client(s)  after which the ctdb daemons will all terminate.

this eliminates the need to using sleep() in some of the test applications

(This used to be ctdb commit f35db69dc190b11659aad85495bb66308fdb5599)
2007-04-18 14:08:45 +10:00
Andrew Tridgell
f57793077f merge fetch1 changes from ronnie
(This used to be ctdb commit 906419acf121ea93661f91bde65cdcd890f70e63)
2007-04-18 12:39:12 +10:00
Ronnie sahlberg
e390c925c1 initial shutdown function where a client can request an orderly shutdown of a ctdb cluster
(This used to be ctdb commit 00d2748bd4e7209ff7e253f6652fdd9bf16cf147)
2007-04-18 12:39:03 +10:00
Andrew Tridgell
7a02b09b01 started adding a cleaner daemon finish method
(This used to be ctdb commit 5ef0cd83d7f24616dad85cece485b770376ecd45)
2007-04-18 11:55:54 +10:00
Ronnie sahlberg
c6f2050e05 merge from tridge
(This used to be ctdb commit e83db4d76ea498413ba4314e937d0ff298bd4cb6)
2007-04-18 11:33:19 +10: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
Ronnie sahlberg
1739dbd317 enhance fetch1 test to verify that a lock is released when a client terminates while holding the lock and the next blocked waiting client is assigned the lock
(This used to be ctdb commit 927228299280779664683fca04a7f76b55bef813)
2007-04-18 10:38:11 +10:00
Volker Lendecke
ed32ad028c Be less verbose
(This used to be ctdb commit 7497b5a9031c471c25bf6029c436fd82788b415c)
2007-04-17 23:06:10 +02: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
Andrew Tridgell
8a7b573320 more DEBUG() calls
(This used to be ctdb commit 79f3d63eec5652d87f13875c76e90ead81a26ad9)
2007-04-17 22:27:17 +10:00
Andrew Tridgell
1e2d91c761 moved cmdline.c to common code
(This used to be ctdb commit 32b31a6b91a19fc0c5225cb88c35cc1d14b4a6df)
2007-04-17 22:16:50 +10:00
Andrew Tridgell
7758511568 use the common cmdline code in ctdbd
add a basic debug system with -dXX

(This used to be ctdb commit af9f21cef79f888c57d3b50a23ca787c9567ce60)
2007-04-17 22:13:06 +10:00
Andrew Tridgell
eba2a4b88c start using ctdb_ltdb_lock_fetch_requeue()
(This used to be ctdb commit f89ab3a06b4677f56c92768c3a8ae5ec9f5abbc2)
2007-04-17 16:54:03 +10:00
Andrew Tridgell
296b0c2a20 - send the record header from the client to the daemon when doing a
fetch, to avoid the daemon re-reading it

- suffix the database name with the node name so that testing on
  loopback doesn't result in a name collision in the database open

(This used to be ctdb commit ad30a4db75450643ff146c40faa306a021de3dd2)
2007-04-17 16:20:32 +10:00
Andrew Tridgell
ae6722e845 make sure we unlock
(This used to be ctdb commit c09054f878a88129abb6cce24c7bbf53f61a2648)
2007-04-17 15:33:58 +10:00
Andrew Tridgell
3a3bac80b9 tidyups in test code
(This used to be ctdb commit 43061a4cf9b0995ebe6c86e27f7fc3aacb7bb23e)
2007-04-17 15:01:42 +10:00
Andrew Tridgell
6f9b29da22 - removed the non-daemon mode from ctdb, in order to simplify the
code. It may be added back later once everything is working nicely,
  or simulated using a in-process pipe instead of a unix domain socket

- rewrote the ctdb_fetch_lock() code to follow the new design

(This used to be ctdb commit 5024dd1f305fe1ecc262db2240c56f773b4f28f0)
2007-04-17 14:52:51 +10:00
Ronnie sahlberg
11b5345afc finalize fetch lock changes to get rid of the record handle
(This used to be ctdb commit 36c1e98a5533214d5507699dc5d8bdec35cb28c2)
2007-04-17 12:36:31 +10:00
Ronnie sahlberg
e5fff3d611 do not use a ctdb_record_handle for client fetch_lock/store_unlock any more
change ctdb_client_fetch_lock to return a status code instead of a record handle and make it unconditionally fill in data.

change ctdb_client_store_unlock to take ctdb_db and key as arguments instead of a record handle

update the ctdb_fetch.c test to use the clientside helpers for fetching and storing data

(This used to be ctdb commit 22d5d40375e0135916c97945646f94119612615d)
2007-04-17 12:22:17 +10:00
Ronnie sahlberg
481e029768 initial change to remove store_unlock pdu and use tdb chainlock in the client
(This used to be ctdb commit 87dd265d2c61125ca2fa922cfcf9371a234fff0c)
2007-04-17 11:34:45 +10:00
Andrew Tridgell
4c787fdff5 darn, forgot this
(This used to be ctdb commit 0feb5da60c0331f6c391622910ca1f436263ce46)
2007-04-17 07:41:27 +10:00
Andrew Tridgell
fca41760e3 wait on the right fd ....
(This used to be ctdb commit 27b67ee6576b17f8b3aae024ae3bd0bb1c42f0f2)
2007-04-17 00:11:04 +10:00
Andrew Tridgell
b3ed006ef4 fixed a fd bug (thanks volker)
(This used to be ctdb commit 512a96de1b31e856785749ffc0bed60b1c589f9e)
2007-04-16 22:49:37 +10:00
Andrew Tridgell
07ade5e488 this is a demonstration of an idea for handling locks in ctdb.
The problem we have is this:

  - we want the client smbd processes to be able to 'shortcut' access
    to the ltdb, by directly accessing the ltdb, and if the header of
    the record shows we are the dmaster then process immediately, with
    no overhead of talking across the unix domain socket

  - a client doing a shortcut will use tdb_chainlock() to lock the
    record while processing

  - we want the main ctdb daemon to be able to set locks on the
    record, and when those locks collide with a 'shortcut' fcntl lock,
    we want the ctdb daemon to keep processing other operations

  - we don't want to have to send a message from a smbd client to the
    ctdbd each time it releases a lock

The solution is shown in this example. Note that the expensive fork()
and blocking lock is only paid in case of contention, so in the median
case I think this is zero cost.

(This used to be ctdb commit a3248c3e2b740cd2403acffd3c1f6a33dca0ea03)
2007-04-16 16:01:37 +10:00
Andrew Tridgell
36cfd2cc64 pull out common command line code for tests into tests/cmdline.c
(This used to be ctdb commit de3db72c1fd0e56ac2b8d8fe962c725dc64f2051)
2007-04-16 14:12:50 +10:00
Ronnie sahlberg
18595074d3 add code to fetch1 test to tell the two child processes one at a time to fetch_lock the same record
they both successfully fetch and lock the same record at this stage  but when the actual locking works properly  the second child will block.

this test allows us to verify the blocking once we have implemented it

(This used to be ctdb commit b1c0baa03a669757aaacb6e1a2794224f5ba2cd7)
2007-04-16 08:37:27 +10:00
Ronnie sahlberg
fc866963fa update to fetch1.sh test
there is still a bug in the ctdb code in that the children no longer receive messages from the parent for unknown reasons

(This used to be ctdb commit 468f68e4607900c5c38aea428a48dd6ea1647411)
2007-04-15 14:02:39 +10:00
Ronnie sahlberg
9f7d98380b merge from tridge
(This used to be ctdb commit 9c4e5569b82d9c7894e3ac1d5f0783c4d770daf4)
2007-04-13 21:10:20 +10:00
Andrew Tridgell
65cdf2297a private -> private_data for samba3
(This used to be ctdb commit 080b6901173afb2ad618dd0621876ff478c7d6e5)
2007-04-13 20:38:24 +10:00
Ronnie sahlberg
332f5ad063 add missing code to store_unlock so that the data that a client writes is stored in ltdb
this makes it possible to do fetch_lock and store_unlock across a domain socket to read/write data.


note that the actual locking is NOT implemented yet

(This used to be ctdb commit c7a397c56caf71283c081e5b97620085ed5108c6)
2007-04-13 20:37:41 +10:00
Ronnie sahlberg
673b879a3f add more elaborate test to fetch1 test
for now:
fetch a record
store a known entry for this record
fetch the record again  (and later verify we got the same record)
store it back again

this will not work right now since we dont yet store the record inside the daemon

(This used to be ctdb commit f502094499a3c25ab58aa3d192588b5e6dd2b8e4)
2007-04-13 09:44:56 +10:00
Ronnie sahlberg
03c49c0526 add store_unlock pdu's for the domain socket.
note that the store_unlock does not actually do anything yet apart from passing the pdu from client to daemon   and daemon responds.

next is to make sure the daemon actually stores the data in a database

(This used to be ctdb commit 167d6993e78f6a1d0f6607ef66925a14993ae6a1)
2007-04-13 09:41:15 +10:00
Ronnie sahlberg
ba162178b9 add the two missing file from the previous commit
(This used to be ctdb commit 3753b64e4e64446dc1f20ec92b45ba11bc0e0be5)
2007-04-12 21:19:00 +10:00
Ronnie sahlberg
1116851c19 dont hardcode gdb in the test script. ooops
(This used to be ctdb commit e193d69cd8cdd293379ab88d25e6984b584afa22)
2007-04-12 16:49:37 +10:00
Ronnie sahlberg
35ffefb01f initial support for two new pdus for the domain socket to do fetch_lock
no locking is yet done and the store_unlock call is still missing


the ./tests/fetch.sh --daemon  test fails with parent process dying which needs to be investigated.

(This used to be ctdb commit 7d7141c968950a8856f1be79871932b688bfb07f)
2007-04-12 15:46:50 +10:00
Ronnie sahlberg
5370e677ec add a test message to the messaging test so we can see that the message data is also passed from originator to receiver
(This used to be ctdb commit f9c2ed3cff8eb481bfa80d944d86233e2a7d5d00)
2007-04-12 08:28:54 +10:00
Andrew Tridgell
a91412cb04 added --num-clients option to ctdb_messaging test
(This used to be ctdb commit 2f4e7e34071c8950f6c4d64469c5eb15d0888113)
2007-04-11 15:23:50 +10:00
Andrew Tridgell
06e4f9b968 use the new connect_wait code in the ctdb_messaging test
(This used to be ctdb commit 36980878141c5e506dd7ee021fba6ca7d0ff5ad3)
2007-04-11 15:09:22 +10:00
Andrew Tridgell
c658d5c1e8 merge from ronnie, plus complete the client side of inter-node messaging
(This used to be ctdb commit e605417436855d22343462acae4cbb79a374977e)
2007-04-11 14:05:01 +10:00
Ronnie sahlberg
185cd326da add a test that sends messages between clients connected to the same ctdb
add code to actually pass the messages between clients and ctdb

(This used to be ctdb commit 6d5b55d7b9c611fb5e98765906757a7d82e4bf6b)
2007-04-11 13:43:15 +10:00
Ronnie sahlberg
7821b985a5 merge from tridge
(This used to be ctdb commit a027d468f39fdd95a4bd03e26da90eb229b2a645)
2007-04-11 11:08:20 +10:00
Andrew Tridgell
110fe0c5a5 - add --daemon flag to ctdb_fetch test code
- split client specific routines out of ctdb_daemon.c
 - use ctdb_queue code in message send from client to daemon
 - use clearer names in client/daemon functions
 - use talloc autofree context to avoid global for unlink of socket on
   exit
 - start on API change for message handler, to allow ctdb messaging to
   handle daemon mode with multiple clients

(This used to be ctdb commit 53555db45f3583ae4a32cc3aa9e07fb8ef2a77e3)
2007-04-11 11:01:42 +10:00
Ronnie sahlberg
5cf568c3ca add a call to register the pid for a messengin service
store this pid inside the client structure in the ctdb daemon

(This used to be ctdb commit d4499c5e0403b0348fa36b259164b1cbfcd671b8)
2007-04-10 21:05:29 +10:00
Andrew Tridgell
4f0ea10fb3 added daemon mode to ctdb_bench
(This used to be ctdb commit b1e71018866752d32f59170fd5c8ba01b05694d9)
2007-04-10 14:46:32 +10:00
Ronnie sahlberg
1f3f0ae56d restore the test script that was updated by mistake in the previous checkin
(This used to be ctdb commit 5e2e6a5ce439762876f2aa054fdd0d4bb54c403c)
2007-04-10 12:23:10 +10:00
Ronnie sahlberg
b84ade51db add a CONNECT_WAIT flag to replace the call ctdb_connect_wait() since
we can no longer use this function from the application if we are in daemon mode.


add a horrible "sleep()" to ctdb_test.c   to prevent the daemon from dissapearing (parent process died) when the application exits which may happen before the other nodes in the test have finished talking to our daemon

(This used to be ctdb commit 74d35dafe06d71e755f3a58cc58d4b9b56fc821b)
2007-04-10 12:18:58 +10:00
Ronnie sahlberg
c7e54e1437 change ctdb_client_read() to use the ctdb_read_pdu() helper
(This used to be ctdb commit d476aa8533b394af6aced9c80fffaf0eefae1dd0)
2007-04-10 08:38:29 +10:00
Ronnie sahlberg
190b97f0ed make normal/deamon mode controllable by a ctdb flag so that the api looks the same in both modes to a client.
send the correct structure back to a client

assorted other cleanups

(tests/test1.sh now works in daemon mode)

(This used to be ctdb commit f4593754cab750dfdb9384884502e2e1b8fde1f0)
2007-04-10 06:03:39 +10:00
Ronnie sahlberg
b384019536 dispatcher daemon first try.
does not yet work

(This used to be ctdb commit ff428808c6546d6f2804a1ac1cf414d1bb9cdcb4)
2007-04-09 11:51:27 +10:00
Andrew Tridgell
3e198a567b remove talloc debug code
(This used to be ctdb commit d883c1bbd4d3691a0787d37c226051f4fce4d45d)
2007-04-07 10:46:47 +10:00
Andrew Tridgell
01c4a086e7 fixed a bunch of memory leaks
(This used to be ctdb commit 2ba2522f2def3032c89c7973915610a245842b07)
2007-04-07 10:45:00 +10:00
Andrew Tridgell
7074b3c94c put test code in tests/ directory
(This used to be ctdb commit 6dbb36f27dd0f8ac00c7a010108d4fba15753479)
2007-04-07 10:01:09 +10:00
Andrew Tridgell
230c97b04d merge fetch code from ronnie, and add a simple fetch test
(This used to be ctdb commit 83b794befd8d34b3da544a483f9d39a3fa140655)
2007-04-05 13:18:31 +10:00
Andrew Tridgell
8be5bdd671 added a benchmark script that launches via ssh
(This used to be ctdb commit 7eeeb9c1d8f82739015ce78d8c90291baf3b1982)
2007-02-20 13:23:01 +11:00
Peter Somogyi
8b6f1c39e7 Some minor changes before integrating ib...
(This used to be ctdb commit fa39ad5054de6e781ca980b9e24d22fa0c67e9ae)
2007-02-12 16:47:12 +01:00
Peter Somogyi
3e9e91103b Merged tridge's code.
(I had error 206 at direct bzr merge, so 1st I did a "bzr branch" and merged that one.)

(This used to be ctdb commit 9d4d2a8e034f1288583eb98c0f48a51ff323ccac)
2007-02-12 15:13:22 +01:00
Peter Somogyi
1966bdbff4 ib: adjustment of a test scenario
(This used to be ctdb commit be9d147e754f41bef9c34d1e924c03172ff96a7f)
2007-02-09 18:06:13 +01:00
Andrew Tridgell
16a3a6d0cb added a simple benchmark script
(This used to be ctdb commit 508cca97083bf21bcce3505d0964dd33a8298624)
2007-02-09 12:46:16 +11:00
Peter Somogyi
cae71b84d6 ib: fragment sent buf + many bugfixes
It came to light I have to fragment the send buffer in case destination's to fit receiver's buffers.
Additionally fixed many bugs.
Still testing.
+ TODO: clean code.

(This used to be ctdb commit 2f8876f09bc92169487cb077326579044560a121)
2007-02-08 19:06:14 +01:00
Peter Somogyi
3222a41b9b Added variable msg size scenario.
Detected 1 bug, fixing...

(This used to be ctdb commit 0b7bbd6d7f74f102c475f92448609673dc5efdca)
2007-02-02 18:54:57 +01:00
Peter Somogyi
36d53e5043 2 bugfixes
- ibw_stop handling
- ibw_send: < instead of <=

(This used to be ctdb commit 4774ef7e9e33f26745346b9bfe445d913f196e81)
2007-02-01 18:46:44 +01:00
Peter Somogyi
116bdb2590 Added overload test scenario + fixed 1 send queue bug.
TODO: externize debug level

(This used to be ctdb commit 98442ce3e2b3f09ca6736abfa0a8314cbdafaac7)
2007-01-30 18:47:26 +01:00
Peter Somogyi
952a1ba44d Adjusted debug level and test scenario.
(This used to be ctdb commit 7d87132195e603f936368da5dd4cb6754c45b721)
2007-01-26 16:45:51 +01:00
Peter Somogyi
d47db1daaa Adjusted ib test tool #1.
Now fixed number of pingpong messages can be sent and then exit.

(This used to be ctdb commit 993188cf4df055a65cb49e91a368e9de1d68b6cf)
2007-01-25 18:57:47 +01:00
Peter Somogyi
7c3982eb3b 1st "working" ib version.
TODO: stress test, variable size messages, flood

(This used to be ctdb commit 5f2a834fdcebe349aad095010ae01cce788b6482)
2007-01-25 11:01:59 +01:00
Peter Somogyi
96f10d7ff4 Added trace messages + several fixes
(This used to be ctdb commit 7d05cb6d0d8f222d7ba1cb1fe939d06a2176f3b6)
2006-12-21 17:41:48 +01:00
Peter Somogyi
96035955be Modified send logic to allow large messages.
TODO: receiver side.

(This used to be ctdb commit 5ca8a53b10990a09390f174bf5eacf07fc5540c2)
2006-12-18 20:52:49 +01:00
Andrew Tridgell
1f44ccb569 added a 4 node test
(This used to be ctdb commit 982468d0770684ec18cf95e3f254250debf4fd4c)
2006-12-18 16:05:22 +11:00
Andrew Tridgell
abf3b910be next step towards dmaster/lmaster code
(This used to be ctdb commit 95e7be8d1aaafafb574c406fe778093606a28be8)
2006-12-18 14:05:49 +11:00
Peter Somogyi
522ad11f06 Raw impl. of ibwrapper test tool.
(basic functional test, compilable, untested)
Adjusted makefile and ibwrapper state checking.

(This used to be ctdb commit 82410f42fe5d428eda0ba96c11774e142f672d24)
2006-12-14 18:21:39 +01:00
Andrew Tridgell
7e21f51b05 - added a 1 node test
- only need 10 elements in test code, more just makes it hard to
  follow in a debugger

(This used to be ctdb commit 7df191112b10466a35a4ff130dade52a6c3c2646)
2006-12-01 10:23:03 +11:00
Andrew Tridgell
fdb317facf - added simple (fake) vnn system
- split up ctdb layer code into 3 modules

- added a simple test suite

- added packet structures for ctdb_call

- switched to an array for ctdb_node to make vnn lookup easy and fast

(This used to be ctdb commit 8a17460a816a5970f2df8244a06aec55d814f186)
2006-11-28 17:56:10 +11:00