1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

2282 Commits

Author SHA1 Message Date
Ronnie Sahlberg
df00979158 When we create new election data to send during elections, we must re-read the node flags from the main daemon to catch when the STOPPED flag is changed.
(This used to be ctdb commit ca4982c40d81db528fe915d5ecc01fcf7df0b522)
2009-07-17 11:37:03 +10:00
Ronnie Sahlberg
9c6aa4e420 update the eventscript to ensure that stopped nodes can not become the natgw master
also verify that we actually do have a natgw master available if this is configured and make the node unhealthy if not.

(This used to be ctdb commit 7f273ee769d671d8c8be87c9187302fb77e814f3)
2009-07-17 09:45:05 +10:00
Ronnie Sahlberg
5ce69e2fa3 if all nodes are STOPPED, pick one of the STOPPED nodes as natgw master
(This used to be ctdb commit 8bbd96cfbbe98f3fc19e432797cbf4478f753a0b)
2009-07-17 09:36:22 +10:00
Ronnie Sahlberg
bf9ad9c934 Do not allow STOPPED or DELETED nodes to become the NATGW master
(This used to be ctdb commit 4505ea15408ad40dd8deb4041fd75a65a0ad9336)
2009-07-17 09:29:58 +10:00
Ronnie Sahlberg
0c5f5ae58d stopped nodes can not win a recmaster election
stopped nodes must yield the recmaster role

(This used to be ctdb commit b75ac1185481060ab71bd743e1e48d333d716eba)
2009-07-09 14:44:03 +10:00
Ronnie Sahlberg
b57811bee6 change the infolevel when logging stop/continue commands
(This used to be ctdb commit 1e007c833098b03dd81797c081da1ae1b10c971c)
2009-07-09 14:34:12 +10:00
Ronnie Sahlberg
82c1be95ed recovery daemon needs to monitor when the local ctdb daemon is stopped and ensure that the databases gets frozen and the node enters recovery mode
(This used to be ctdb commit 99f239f8b96c8c0a06ac8ca8b8083be96265865a)
2009-07-09 14:19:32 +10:00
Ronnie Sahlberg
9d0941bf83 document the new commands ctdb stop/continue
(This used to be ctdb commit d6ddea4167ccdad05e88378ee3f22b6125969562)
2009-07-09 13:07:15 +10:00
Ronnie Sahlberg
41a519191e dont let other nodes modify the STOPPED flag for the local process when pushing out flags changes
(This used to be ctdb commit 501a2747d839ca291b70c761098549cf6d47a158)
2009-07-09 13:20:14 +10:00
Ronnie Sahlberg
88f3c40d9c add two new controls, CTOP_NODE and CONTINUE_NODE
that are used to stop/continue a node instead of using modflags messages

(This used to be ctdb commit 54b4a02053a0f98f8c424e7f658890254023d39a)
2009-07-09 12:22:46 +10:00
Ronnie Sahlberg
66c8d4fb3d make it possible to start the daemon in STOPPED mode
(This used to be ctdb commit 866aa995dc029db6e510060e9e95a8ca149094ac)
2009-07-09 11:57:20 +10:00
Ronnie Sahlberg
d6a5fd5c9d remove the header printed for the machinereadable output for natgwlist
(This used to be ctdb commit 049271c83a09afb8d6c3e5212cf9ca782956b0c6)
2009-07-09 11:43:37 +10:00
Ronnie Sahlberg
9f0dc4b93b Add a new node flag : STOPPED
This node flag means the node is DISABLED and that all its public ip addresses
are failed over, but also that it has been removed from the VNNmap.

A STOPPED node should be in recovery mode active untill restarted using the continue command.

Adding two new commands "ctdb stop" "ctdb continue"

(This used to be ctdb commit d47dab1026deba0554f21282a59bd172209ea066)
2009-07-09 11:38:18 +10:00
Martin Schwenke
d6862832ed Merge branch 'ronnie_merge'
(This used to be ctdb commit 2ff6ee042080ba1c2bea76bbef3742997d84c9a8)
2009-07-08 14:21:36 +10:00
Martin Schwenke
cfbe41b532 Merge commit 'origin/master' into ronnie_merge
Conflicts:
	config/ctdb.init

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

(This used to be ctdb commit 823019870c0831258b96654646f71e9dd69317ec)
2009-07-08 14:21:05 +10:00
Martin Schwenke
168ec02adf Test suite: new tests and code factoring.
* 2 new tests for NFS failover.

* Factor repeated code from tests into new functions
  select_test_node_and_ips(), gratarp_sniff_start() and
  gratarp_sniff_wait_show().  Use these new functions in existing and
  new tests.

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

(This used to be ctdb commit de0b58e18fcc0f90075fca74077ab62ae8dab5da)
2009-07-08 13:37:52 +10:00
Martin Schwenke
dae498a1e7 Test suite: better debug info when the cluster is unexpectedly unhealthy.
cluster_is_healthy() is now run locally in tests and internally causes
_cluster_is_healthy() to be run on node 0.  When it detects that the
cluster is unhealthy and $ctdb_test_restart_scheduled is not true,
debug information is printed.  This replaces the previous use of
$CTDB_TEST_CLEANING_UP.

To avoid spurious debug on expected restarts, added scheduled
restarts to several tests.

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

(This used to be ctdb commit b67946a6f6b185a7920bf1e560988417c8c4d87d)
2009-07-08 09:45:35 +10:00
Martin Schwenke
7e1cdac0ab Make ctdbd restarts in tests more reliable.
This works around potential race conditions in the init script where
the restart operation is not necessarily reliable.  It just wraps the
actual restart in a loop and tries for a successful restart up to 5
times.

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

(This used to be ctdb commit 3f7a4afa0fcc5825beb89267973939df8cde4999)
2009-07-08 09:43:55 +10:00
Martin Schwenke
4bd8e0d87a When testing make the time taken for some operations more obvious.
If wait_until() does not timeout, print the time taken for the command
to succeed.

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

(This used to be ctdb commit 8d12fe61eb59a4a611dd5950506d14bd4891075d)
2009-07-08 09:43:45 +10:00
Martin Schwenke
21a891cb79 New tests for different aspects of failover.
3 separate tests:

* Check that gratuitous ARPs are received and take effect.

* Check that ping still works after failover.

* Check, via SSH, that the hostname changes after failover.

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

(This used to be ctdb commit aa9f79e4b3e077b48a8a16903d2236c284617e49)
2009-07-08 09:43:29 +10:00
Martin Schwenke
55a04d757f Updates to TCP tickle tests and supporting functions.
* Removed a race from tpcdump_start().  It seems impossible to tell
  when tcpdump is actually ready to capture packets.  So this function
  now generates some dummy ping packets and waits until it sees them
  in the output file.

* tcpdump_start() sets $tcpdump_filter.  This is the default filter
  for tcpdump_wait() and tcpdump_show(), but other filters may be
  passed to those functions.

* New functions tcptickle_sniff_start() and
  tcptickle_sniff_wait_show() handle capturing TCP tickle packets.
  These are used by complex/31_nfs_tickle.sh and
  complex/32_cifs_tickle.sh.

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

(This used to be ctdb commit 52e1cd7e9217cfa521850a9a9a9daddcce011f27)
2009-07-08 09:43:01 +10:00
Martin Schwenke
4edbb2e5f2 Add an extra ctdb recovery to test function restart_ctdb().
There are still very rare cases where IPs haven't been reallocated
before the beginning of the next test, so this adds a sleep and an
extra call to "ctdb recover" to restart_ctdb().

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

(This used to be ctdb commit 7c27c493a6de92544754e42f2a8f227b3d663c73)
2009-07-08 09:42:10 +10:00
Martin Schwenke
74acb6f97e Fix the run_tests script so that the number of columns is never 0.
Sometimes "stty size" reports 0, for example when running in a shell
under Emacs.  In this case, we just change it to 80.

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

(This used to be ctdb commit da87914ab47fe5786b620587464b58853e98dd7e)
2009-07-08 09:41:06 +10:00
Martin Schwenke
5824f3aca9 Separate test cleanup code in output and clean up ctdb restart code.
* ctdb_restart_when_done() now schedules a restart by setting an
  explicit variable that is respected in ctdb_test_exit(), rather than
  adding a restart to $ctdb_test_exit_hook.  This means that restarts
  are all done in one place.

* ctdb_test_exit() turns off "set -e" to make sure that all cleanup
  happens.

* ctdb_test_exit() now prints a clear message indicating where the
  test ends and the cleanup begins.  This message also includes the
  return code of the test.

* Add debug in cluster_is_healthy to try to capture information about
  unexpected unhealthiness when a test starts.

* Simplify simple/07_ctdb_process_exists.sh so that the exit code is
  generated more obviously.

* Remove redundant calls to ctdb_test_exit at the end of tests, since
  they're done automatically via a trap.  Also remove any preceding
  warnings of restarts or final hints about test success/failure.

* Allow multi-digit debug levels in simple/12_ctdb_getdebug.sh and
  simple/13_ctdb_setdebug.sh.

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

(This used to be ctdb commit 56ece515e047a54f33e8b07726e52ba21a1d67e1)
2009-07-08 09:40:11 +10:00
Ronnie Sahlberg
2708b305ca Initscript cleanups.
* Move building of CTDB_OPTIONS to new function build_ctdb_options()
  and have it use a helper function for readability.

* New functions check_persistent_databases() and set_ctdb_variables().

* Remove valgrind-specific stop code, since the general pkill should
  kill ctdbd when running under valgrind.

* Remove some bash-isms (e.g. >& /dev/null) since the script is /bin/sh.

* Make indentation consistent.

* Minor clean-ups.

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

Conflicts:

	config/ctdb.init

(This used to be ctdb commit bebb21f18e3026cb78a306104e92ee005d1077b2)
2009-07-07 13:45:19 +10:00
Ronnie Sahlberg
021c09a842 Merge root@10.1.1.27:/shared/ctdb/ctdb-git
(This used to be ctdb commit 5e3b590e384bacfbebab1dd85e89cd87b63c620e)
2009-07-07 11:19:44 +10:00
Ronnie Sahlberg
1593e67399 send ARPs with an interval of 1.1 seconds during ip takeover.
this is to better handle linux clients which often default to ignore grat arps that arrive within 1 second of eachother.

(This used to be ctdb commit 5664da36943b4901a807a9594b0f45e859aafbf3)
2009-07-07 11:40:01 +10:00
Martin Schwenke
96b3517356 Test suite: better debug info when the cluster is unexpectedly unhealthy.
cluster_is_healthy() is now run locally in tests and internally causes
_cluster_is_healthy() to be run on node 0.  When it detects that the
cluster is unhealthy and $ctdb_test_restart_scheduled is not true,
debug information is printed.  This replaces the previous use of
$CTDB_TEST_CLEANING_UP.

To avoid spurious debug on expected restarts, added scheduled
restarts to several tests.

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

(This used to be ctdb commit ee7caae3a55a64fb50cd28fa2fd4663c5dd83b4f)
2009-07-06 17:52:11 +10:00
Martin Schwenke
d90d54ea3e Make ctdbd restarts in tests more reliable.
This works around potential race conditions in the init script where
the restart operation is not necessarily reliable.  It just wraps the
actual restart in a loop and tries for a successful restart up to 5
times.

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

(This used to be ctdb commit 1cac8a0ad429f29d1508158c7f7c42a2f1a22945)
2009-07-06 16:40:31 +10:00
Martin Schwenke
35f998346e When testing make the time taken for some operations more obvious.
If wait_until() does not timeout, print the time taken for the command
to succeed.

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

(This used to be ctdb commit bdb856ee22816ae1f6b8d15856555f488054f489)
2009-07-06 16:39:08 +10:00
Ronnie Sahlberg
20887a15ad Perform an ipreallocate efter each enable/disable.
This will force a wait until the ip addresses have been reallocated after a disable/enable command and will make scripting of enable/disable more predictable.

This will cause the command enable/disable to wait until the ip realocation that normally follows shortly after a enable/disable to finish before the command returns to the prompt.

(This used to be ctdb commit 6e1f60d8d780c1240aaabb78ecc8550d0480cd7e)
2009-07-06 11:49:55 +10:00
Ronnie Sahlberg
8c1bf5abb0 Merge root@10.1.1.27:/shared/ctdb/ctdb-git
(This used to be ctdb commit 49e7584679c7467a367888c5b14529c8e338f032)
2009-07-06 11:28:10 +10:00
Martin Schwenke
5d67aa2332 New tests for different aspects of failover.
3 separate tests:

* Check that gratuitous ARPs are received and take effect.

* Check that ping still works after failover.

* Check, via SSH, that the hostname changes after failover.

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

(This used to be ctdb commit 92011cc05bbdb517ec6a4573f5cb9f6f21c3059e)
2009-07-03 20:55:02 +10:00
Martin Schwenke
613341d150 Updates to TCP tickle tests and supporting functions.
* Removed a race from tpcdump_start().  It seems impossible to tell
  when tcpdump is actually ready to capture packets.  So this function
  now generates some dummy ping packets and waits until it sees them
  in the output file.

* tcpdump_start() sets $tcpdump_filter.  This is the default filter
  for tcpdump_wait() and tcpdump_show(), but other filters may be
  passed to those functions.

* New functions tcptickle_sniff_start() and
  tcptickle_sniff_wait_show() handle capturing TCP tickle packets.
  These are used by complex/31_nfs_tickle.sh and
  complex/32_cifs_tickle.sh.

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

(This used to be ctdb commit 8e2a89935a969340bfead8ed040d74703947cb81)
2009-07-03 20:44:55 +10:00
Martin Schwenke
7b3abce684 Add an extra ctdb recovery to test function restart_ctdb().
There are still very rare cases where IPs haven't been reallocated
before the beginning of the next test, so this adds a sleep and an
extra call to "ctdb recover" to restart_ctdb().

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

(This used to be ctdb commit c2bdb77d91761c003e2f0e6918a27c54150f6030)
2009-07-03 18:01:29 +10:00
Martin Schwenke
dba6c1ca77 Fix the run_tests script so that the number of columns is never 0.
Sometimes "stty size" reports 0, for example when running in a shell
under Emacs.  In this case, we just change it to 80.

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

(This used to be ctdb commit e309cb3f95efcf6cff7d7c19713d7b161a138383)
2009-07-03 17:58:38 +10:00
Martin Schwenke
0d425a07d4 Separate test cleanup code in output and clean up ctdb restart code.
* ctdb_restart_when_done() now schedules a restart by setting an
  explicit variable that is respected in ctdb_test_exit(), rather than
  adding a restart to $ctdb_test_exit_hook.  This means that restarts
  are all done in one place.

* ctdb_test_exit() turns off "set -e" to make sure that all cleanup
  happens.

* ctdb_test_exit() now prints a clear message indicating where the
  test ends and the cleanup begins.  This message also includes the
  return code of the test.

* Add debug in cluster_is_healthy to try to capture information about
  unexpected unhealthiness when a test starts.

* Simplify simple/07_ctdb_process_exists.sh so that the exit code is
  generated more obviously.

* Remove redundant calls to ctdb_test_exit at the end of tests, since
  they're done automatically via a trap.  Also remove any preceding
  warnings of restarts or final hints about test success/failure.

* Allow multi-digit debug levels in simple/12_ctdb_getdebug.sh and
  simple/13_ctdb_setdebug.sh.

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

(This used to be ctdb commit b6fa044a1364cbb3008085041453ee4885f7ced1)
2009-07-03 17:40:16 +10:00
Ronnie Sahlberg
289c58e9b6 add a new command "ctdb ipreallocate", this command will force the recovery master to perform a full ip reallocation process.
the ctdb command will block until the ip reallocation has comleted

(This used to be ctdb commit abad7b97fe0c066b33f6e75d0953bbed892a3216)
2009-07-02 13:00:26 +10:00
Ronnie Sahlberg
ff104c6f5a When we dispatch a message to a handler, pass the data as a real talloc object so that the handler can talloc_steal() the message content.
(This used to be ctdb commit c69f5fe1db5b6ed4a009f0c10ab82c6f32b2e0bc)
2009-07-02 12:58:49 +10:00
Ronnie Sahlberg
e40dad890c document the ipreallocate command
(This used to be ctdb commit 6baaf5bec3ba0094c71d83315170acb5dc729711)
2009-07-02 12:45:14 +10:00
Ronnie Sahlberg
8e435c0605 update enable/disable
(This used to be ctdb commit b99afc98bedf1a51d315e311f27c3fc55fd940e7)
2009-07-01 09:33:08 +10:00
Ronnie Sahlberg
3c1351eabd update the sysconfig to show setting the debuglevel using a string literal instead of a numeric value
(This used to be ctdb commit 964530d70ba2ca949380d30a0e3d622963a6206c)
2009-07-01 09:23:52 +10:00
Ronnie Sahlberg
2770cb4397 show the valid debuglevels that can be used in the error text when an invalid level was specified to ctdb setdebug
(This used to be ctdb commit 421c0566094b91221fab2ea68f2c9bd35d5dfbcb)
2009-07-01 09:21:07 +10:00
Ronnie Sahlberg
93026f4cbf update the handling of debug levels so that we always can use a literal instead of a numeric value.
validate the input values used and refuse setting the debug level to an unknown value

(This used to be ctdb commit daec49cea1790bcc64599959faf2159dec2c5929)
2009-07-01 09:17:13 +10:00
Ronnie Sahlberg
9802a0c2f6 when no debuglevel is specified, make 'ctdb setdebug' show the available options
(This used to be ctdb commit f4b0825d9da34578b9f90dc9bd7f99fcc2519ddf)
2009-07-01 08:26:00 +10:00
Ronnie Sahlberg
e6e1ff32a5 dont try sending a keepalive if the transport is down
(This used to be ctdb commit 5cdc04669db8c2ddbbff5af82307a16e8d807b83)
2009-06-30 12:17:05 +10:00
Ronnie Sahlberg
6450ae533a Dont even try allocating and sending a CALL packet if the transport is down
(This used to be ctdb commit cb8dd896914d4e44ad7b8bb000176a7c78f394ae)
2009-06-30 12:16:13 +10:00
Ronnie Sahlberg
127754e192 failing a dmaster send due to the transport being down is fatal
(This used to be ctdb commit c17dafc79bec25bbb796478c33f503503d382a20)
2009-06-30 12:14:58 +10:00
Ronnie Sahlberg
757ba01ddc if we fail a dmaster migration due to the transport being down, then that is a fatal condition.
(This used to be ctdb commit 75dea671f68ac6649095357c36b3697a927721e9)
2009-06-30 12:13:15 +10:00
Ronnie Sahlberg
dd1774cd85 dont try to send error packets if the transport is down
(This used to be ctdb commit 65b94d280731df3245b26d69f39acfaf5bccf0d8)
2009-06-30 12:10:27 +10:00