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

370 Commits

Author SHA1 Message Date
Martin Schwenke
aca9d7f104 Merge branch 'onnode_options'
(This used to be ctdb commit 454125ccfda04aa6b4e14f5c05164d29f41a0ead)
2009-10-16 16:39:46 +11:00
Martin Schwenke
f0dd32e412 Merge commit 'origin/master' into onnode_options
(This used to be ctdb commit e62928f56ce8927b1d8686db2c31538c86462d1a)
2009-10-14 13:49:30 +11:00
Martin Schwenke
787a6e44c6 New onnode options: -f to specify nodes file, -n to allow use of hostnames.
The -f option allows an alternate nodes file to be specified,
overriding the CTDB_NODES_FILE environment variable.

The -n option allows hostnames to be used instead of node numbers.
Using a range of hostnames is invalid, so hostnames can't contain
hyphens ('-') - sorry!  You can use this option without a nodes file
by specifying "-f /dev/null".

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

(This used to be ctdb commit 46474e5f21fd97dd765c616647ff46055a9970e7)
2009-10-14 13:44:57 +11:00
Ronnie Sahlberg
80be59d35e when we change state between healthy/unhealthy, make sure we ask the recovery
master to perform an explicit ip reallocation.

This is more reliable and faster than having the recovery dameon track these
changes, and since we now have an explicit method to ask the recovery daemon
to perform an explicit ip reallocation, we should use this.

(This used to be ctdb commit 3807681e74f4bfe92befdae6ed616ff5f1a99880)
2009-10-14 11:59:16 +11:00
Ronnie Sahlberg
98b5caf003 we must break the loop as soon as we find a suitable recmaster does exist
otherwise "tdb ipreallocate" will silently fail to update the addresses.

(This used to be ctdb commit 346fa055f4106497b87df97da5ebd6e51fa1ef8c)
2009-10-13 09:49:05 +11:00
Ronnie Sahlberg
771802b212 allow setting the recmode even when not completely frozen.
we sometimes have to do this when we want to trigger a recovery

(This used to be ctdb commit 46194e87e189521375b39b4ef33da2b493429fd8)
2009-10-12 13:06:16 +11:00
Ronnie Sahlberg
d4c98516a2 uptade the freeze/thaw commands to be able to send the requested database priority to freeze/thaw to the daemon.
this is encoded in the srvid field of the request header

(This used to be ctdb commit 0cb3d33caa42ed783e03bc825b181dde4cf63616)
2009-10-12 09:22:17 +11:00
Ronnie Sahlberg
3219f81710 add a control to read the db priority from a database
(This used to be ctdb commit ca6d045e419f308f57e74d4c978907afb05ddb85)
2009-10-10 15:04:18 +11:00
Ronnie Sahlberg
6cf7d8e131 add a control to set a database priority. Let newly created databases default to priority 1.
database priorities will be used to control in which order databases are locked during recovery in.

(This used to be ctdb commit 67741c0ee01916d94cace8e9462ef02507e06078)
2009-10-10 14:26:09 +11:00
Ronnie Sahlberg
134ed842fa always send the release/take ip controls to make sure all nodes are updated
(This used to be ctdb commit 789703ea684717781c176fd3a2a24d96abde220b)
2009-10-06 12:25:44 +11:00
Ronnie Sahlberg
166b1c97b4 add a new message to ask the recovery daemon to temporarily disable checking ip address consistency.
This is useful when we are moving addresses using moveip in the cluster since otherwise if we collide with the recovery daemons own check we could cause a recovery

(This used to be ctdb commit 9c63858c0b22c81eaccb9865a414af0bbb2833d4)
2009-10-06 12:11:32 +11:00
Ronnie Sahlberg
617e393f6b update addip/moveip/delip to make it less likely to trigger an accidental recovery
(This used to be ctdb commit 3befe5526e147d49451fddc930aaafc3dbe2e9c1)
2009-10-06 11:41:18 +11:00
Ronnie Sahlberg
709fc77878 When adding a public ip to a node, make sure to push the assignment of ip addresses out to all nodes so all nodes become aware who currently holds the ip.
(This used to be ctdb commit e8df6fc301fb7faf72c72eb39ea68d44d1526b00)
2009-10-06 08:19:25 +11:00
Ronnie Sahlberg
22dde50be3 add machinereadable output for the ctdb getreclock command
(This used to be ctdb commit 5e7dc36f1649824db2f9dab34bede8b388502a57)
2009-09-28 13:39:54 +10: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
Martin Schwenke
021892346c onnode: add "any" nodespec to select any node with running CTDB.
In testing and other situations (e.g. eventscripts) it is necessary to
select a node where a ctdb command can be run.  The whole idea here is
to avoid nodes where ctdbd is not running and where most ctdb commands
would fail.  This implements a standard way of doing this involving a
recursive onnode command.

There is still a small window for a race, where the selected node is
suddenly shutdown, but this is unavoidable.

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

(This used to be ctdb commit fb47cce86c0edae5caaf485f13ae7a151b6cb00d)
2009-09-08 15:10:20 +10:00
Ronnie Sahlberg
cda5f02c7c new prototype banning code
(This used to be ctdb commit 0c4c2240267af183d54ffd4c0aacda208f6eff6a)
2009-09-04 02:20:39 +10:00
Ronnie Sahlberg
ef9db0efc3 reduce the loglevel for the message that we switch to a different recmaster while waiting for ipreallocate to finish
(This used to be ctdb commit e5b25e1386294b1f800c32fb01c69c3c3ce85c26)
2009-08-17 10:56:12 +10:00
Ronnie Sahlberg
486bdd8ca1 if no timeout at all is specified to the ctdb tool, neither using -T nor by setting CGTDB_TIMEOUT, then use 120 seconds as a default timepout before the ctdb command will exit with an error.
(This used to be ctdb commit d8d21884736a9610d48cf532e1c6778e511fb7a8)
2009-08-17 10:54:45 +10:00
Ronnie Sahlberg
1cc79905ad add new controls to make it possible to enable/disable individual eventscripts
update scriptstatus output so it lists disabled scripts

(This used to be ctdb commit 7e799b7523c9699bd65a8a8207f7e03d668b0b81)
2009-08-13 13:04:08 +10:00
Ronnie Sahlberg
0e09e52824 update STOP/CONTINUE to better handle when we stop the last node
(This used to be ctdb commit 9a251078f22aea15b9ca37393e0b5e2740aa21fb)
2009-08-03 12:51:55 +10:00
Martin Schwenke
e50a067cb5 Merge commit 'origin/master'
(This used to be ctdb commit d7ff60a74595dcb4ae41f5a8193de5b898d61227)
2009-07-29 10:08:56 +10:00
Ronnie Sahlberg
62c4a841d2 When processing the stop node control reply in the client code we should
also check the returned status code in case the _stop() command failed
due to the eventscripts failing.

If this happens, make "ctdb stop" log an error to the console and try
the operation again.

(This used to be ctdb commit 20e82e0c48e07d1012549f5277f1f5a3f4bd10d1)
2009-07-29 09:58:40 +10:00
Martin Schwenke
50650fbbd1 onnode: update tests for healthy and connected to cope with new stopped bit.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit bfc926c866e361ab28330747544b268ba130bf30)
2009-07-28 16:00:11 +10:00
Ronnie Sahlberg
37d68c58b8 add two commands : setlmasterrole and setrecmasterrole to enable/disable these capabilities at runtime
(This used to be ctdb commit 51aaed0e9e42e901451292e8dd545297ab725a62)
2009-07-28 13:45:13 +10:00
Ronnie Sahlberg
72e2380e92 add a command "setnatgwstate {on|off}" that can be used to indicate if this node is using natgw functionality or not.
(This used to be ctdb commit 89a9bb29a60a6fb1fba55987e6cf0a4baa695e50)
2009-07-28 09:58:11 +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
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
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
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
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
8e435c0605 update enable/disable
(This used to be ctdb commit b99afc98bedf1a51d315e311f27c3fc55fd940e7)
2009-07-01 09:33:08 +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
5b235c3999 add a control to set the reclock file
(This used to be ctdb commit 36cc2e586f03fa497ee9b06f3e6afc80219c4aaa)
2009-06-25 14:25:18 +10:00
Ronnie Sahlberg
2b253c094c add a control to read the current reclock file from a node
(This used to be ctdb commit ed6a4cbcdcbb4e0df83bec8be67c30288bf9bd41)
2009-06-25 12:17:19 +10:00
Martin Schwenke
635da189dc Fix minor onnode bugs relating to local daemons.
Commit a0f5148ac749758e2dfbd6099e829c5bf1d900e6 caused a subtle
regression.  Due to the subtlety, this description is much longer than
the 1 line patch that fixes it!  The regression, where a process that
invokes onnode is unexpectedly blocked, is only apparent if the
following conditions are met:

1. $CTDB_NODES_SOCKETS is set;
2. The command passed to onnode attempts to background a process; and
3. onnode is run in certain types of subshell (e.g. foo=$(onnode ...)).

In particular, when testing against local daemons (i.e. condition (1)
is met), tests/simple/07_ctdb_process_exists.sh would fail (because it
does both (2), (3)).

The problem is caused by the use of file descriptor 3 in the code that
allows separate filtering of stdout and stderr.  A backgrounded
process will have this descriptor open and the $(...) construct
appears to wait for all file descriptors to be closed.  This only
happens with local daemons because SSH is replaced by a shell and file
descriptor 3 leaks into that shell.  It does not occur when SSH is
used because the file descriptor does not leak into the remote shell
where the process is backgrounded.

The fix is simply to redirect file descriptor 3 to /dev/null in the
fakessh function, which is used when $CTDB_NODES_SOCKETS is set.

Also fixed is another minor bug when the -o option and
$CTDB_NODES_SOCKETS are used in combination.  The code uses the node
name as a suffix for the output filename(s).  Usually this is an IP
address.  However, when $CTDB_NODES_SOCKETS is in use the node name is
the socket name, which might be a path several directories deep.
Each output file is created via a simple redirection and this would
fail if unexpected directories appear in the filename.  3 possible
fixes were considered:

1. Replace all '/'s in the node name by '_'s.  Nice and simple.
2. Use the basename of the node name.  However, sockets may be in
   different directories but have the same basename.
3. Create all required directories before redirecting.  This is a
   little more complex and probably doesn't meet the user's
   expectations.

Option (1) is implemented here.

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

(This used to be ctdb commit 5d320099025b6835eda3a1e431708f7e0a6b0ba6)
2009-06-19 18:02:17 +10:00
Ronnie Sahlberg
2bb687c4cd remove unused variable
(This used to be ctdb commit 2a52336ec021dfe8d56ba72726feb7b2dbd41f68)
2009-06-09 10:58:46 +10:00
Ronnie Sahlberg
ac931b1371 dont require particular values for NoIPFailback and DeterministicIPs when
using ctdb moveip

(This used to be ctdb commit d350c631850377c09968d2978ef57d2bd0d50116)
2009-06-09 10:57:46 +10:00
Ronnie Sahlberg
f135684766 improve ctdb moveip so that it does not always trigger a recovery.
(This used to be ctdb commit 0ca28d7336463ecd2ff65620d8dbcbb496991531)
2009-06-09 10:56:50 +10:00
Ronnie Sahlberg
f6ccf96898 try avoiding to cause a recovery when deleting a public ip from a node
(This used to be ctdb commit 6318ea13464e2fe630084c40802d8e697c2cb999)
2009-06-05 17:57:14 +10:00
Ronnie Sahlberg
b046f5e3aa when adding an ip, try manually adding and takingover the ip instead of triggering a full recovery to do the same thing
(This used to be ctdb commit 4d5d22e64270cfb31be6acd71f4f97ec43df5b2c)
2009-06-05 17:00:47 +10:00
Ronnie Sahlberg
79eef7f2b5 dont list DELETED nodes in the ctdb listnodes output
(This used to be ctdb commit 7eb137aa4c24c69bd93b98fb3c7108e5f3288ebd)
2009-06-04 13:25:58 +10:00
Ronnie Sahlberg
f691b96d84 make it possible to run 'ctdb listnodes' also if the daemon is not running.
in this case, read the nodes file directly instead of asking the local daemon for the list.

add an option -Y to provide machinereadable output to listnodes

(This used to be ctdb commit 4a55cacc4f5526abd2124460b669e633deeda408)
2009-06-04 13:21:25 +10:00
Ronnie Sahlberg
45aa542064 teach ONNODE about deleted nodes
(This used to be ctdb commit 03d304e72a5839dc8d8d2e2312b346c21dca5774)
2009-06-02 15:03:44 +10:00