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

4997 Commits

Author SHA1 Message Date
Martin Schwenke
fdccaab2a9 ctdb/eventscripts: Do not reconfigure in "monitor" events
"monitor" events can be cancelled.  If a reconfigure action does a
service restart then the "monitor" event can be cancelled at the
inconvenient moment after the service is stopped.  In this case the
service stays down and the node may become unhealthy (depending on
whether there are any repair actions in the monitor event).

A long time ago we did service reconfiguration in "monitor" events
following failovers.  Service reconfiguration was then moved to the
"ipreallocated" event.  However, reconfiguration in "monitor" events
has been kept as a last resort in case an "ipreallocate" event does
not occur.  The only important case that this covers is "ctdb
deleteip", where "releaseip" events are generated without a
corresponding "ipreallocated".  Therefore, IPs can be deleted without
running the required service reconfiguration.

The supported way of removing IP addresses is now via "ctdb
reloadips", which always causes a takeover run with a corresponding
"ipreallocate" event.

This means that service reconfiguration in "monitor" events is no
longer required and should be removed because it is unsafe.

Also update the associated tests.  Make the first confirm that the
monitor event no longer does reconfiguration.  Change the others to
test that monitor status is correctly replayed when something else is
doing a reconfigure and currently holds the reconfigure lock.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Dec 17 06:32:35 CET 2013 on sn-devel-104
2013-12-17 06:32:35 +01:00
Volker Lendecke
c943937ec6 Fix CID 1138340 Resource leak
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-12-17 01:57:12 +01:00
Volker Lendecke
b2937fd618 Fix CID 1138341 Resource leak
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-12-17 01:57:12 +01:00
Michael Adam
c65ad56d40 ctdb:packaging:RPM: don't run autogen.
autogen is already run in maketarball.sh which generates
the tarball for the RPM.

This way, we don't have a rpm build dependency on autoconf.
Recent changes introduced a dependency into autoconf
version >= 2.60, so this fix allows the generated
source RPM to be built also on older platforms.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Dec  9 05:47:00 CET 2013 on sn-devel-104
2013-12-09 05:47:00 +01:00
Michael Adam
7dbb068aa7 ctdb:packaging:RPM: package the new manpages
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2013-12-09 10:35:50 +11:00
Michael Adam
0e8340229b ctdb:build: install the new manpages
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2013-12-09 10:35:26 +11:00
Michael Adam
b0bbb59c49 ctdb:tests: update README
explain how to run individual tests and test collections and remove mention of
tests/scripts/run_tests which does not exist any more.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2013-12-05 00:47:43 +01:00
Martin Schwenke
3c81066105 ctdb/tests/scripts: Promote scripts/run_tests
The wrapper is not needed anymore.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:46:46 +01:00
Martin Schwenke
318f2cf912 ctdb/tests/scripts: Simplify the top-level test scripts
At the moment run_tests.sh has quite fragile argument processing.  It
needs that annoying "--" between options and tests.  The random
default (mktemp -d) for TEST_VAR_DIR is wrong and is worked around in
various places.

Instead:

* Change the default behaviour to print a summary, add new option -N
  to turn off summary, and remove old -s option.

* Change the default behaviour to run integration tests with local
  daemons, add new options -c to run on a cluster, remove old -l
  option.

* Make $testdir/var the default if the tests are not installed, and
  $(mktemp -d ) the default if tests are installed.

* Move the default tests for local/cluster into scripts/run_tests.

run_tests.sh (and the run_cluster_tests.sh symlink) should behave as
before but with slightly more reasonable defaults.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:46:04 +01:00
Martin Schwenke
bbd46e8634 ctdb/tests/scripts: Sort command-line options
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:44:12 +01:00
Martin Schwenke
f67a1043b3 ctdb/tests/integration: Decentralise the daemon restart code
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:43:55 +01:00
Martin Schwenke
f05db5edc4 ctdb/tests/integration: Update daemons shutdown pseudo-test
Don't scatter the TEST_LOCAL_DAEMONS logic around the code.  Limit it
to the local daemons file.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:43:12 +01:00
Martin Schwenke
6b15fe247c ctdb/tests/simple: Local daemons version of setup_ctdb() overrides
setup_ctdb() doesn't need to do anything on a cluster.  To avoid a
conditional, just override it for local daemons.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:41:50 +01:00
Martin Schwenke
85a711f5a8 ctdb/tests/integration: Remove some unused functions
This was the start of some refactorisation that was never completed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:41:25 +01:00
Martin Schwenke
a3fd8ddf35 ctdb/tests/integration: Remove the time logging code
This hasn't been required for a long time and is probably broken.  If
it is needed in future then we know where to find it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:40:37 +01:00
Martin Schwenke
28acce2862 ctdb/tests/simple: Move the local daemons code to its own file
This is just a straight move.  The clever stuff will follow.  :-)

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:39:59 +01:00
Martin Schwenke
ef0e8cc192 ctdb/tests/integration: Update NFS tickles test and supporting code
This currently requires an eventscript to be dynamically installed.
This eventscript is only used to help determine when a monitor event
has occurred.  This code is horrible and fragile.

A better way is to just monitor the output of "ctdb scriptstatus".
When changes it changes then a monitor event has occurred.

Also remove the old code that checks for tickle information in shared
storage.  CTDB hasn't done things this way for a long time.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:39:21 +01:00
Michael Adam
e2db9c524f ctdb:tests: in the stub "ip link show" command use echo instead of cat
This case of "ip link show" does not break autobuild with
"Broken pipe" messages, but let's be consistent.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Nov 28 09:23:03 CET 2013 on sn-devel-104
2013-11-28 09:23:03 +01:00
Michael Adam
fd5e8905a0 ctdb:test: remove unused ip2ipmask from integration.bash
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2013-11-28 07:31:13 +01:00
Michael Adam
e281cfa8db ctdb:tests:76_ctdb_pdb_recovery: change from using ctdb pstore to ctdb ptrans.
This removes the requirement to create a temporary file
and hence makes this test runnable against local daemons
and against a real cluster without further changes.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2013-11-28 07:31:13 +01:00
Michael Adam
30dead171f ctdb:tests:76_ctdb_pdb_recovery: fix a typo in a message
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2013-11-28 07:31:13 +01:00
Michael Adam
3e083f96ff ctdb:tests:76_ctdb_pdb_recovery: fix a typo in a message
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2013-11-28 07:31:12 +01:00
Michael Adam
70f469e05e ctdb:tests: in the stub ip command, avoid broken pipe by using echo instead of cat
This fixes running "make autotest" from autobuild, since
it prevents irritating error output in delete_ip_from_iface()
when calling ip addr list ... | grep -Fq "inet ..." .

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2013-11-28 07:31:12 +01:00
Michael Adam
90f79bf073 ctdb:tests: ignore SIGPIPE in unit tests
This makes scripts called in the unit tests behave like
when called from ctdbd which ignodes SIGPIPE.
This also makes the scrips behave the same when
called from "make autotest" directly and via autobuild (python).

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2013-11-28 07:31:12 +01:00
Michael Adam
e01a7157f3 ctdb:tests: add path of ip command to extra output in the error case
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2013-11-28 07:31:12 +01:00
Michael Adam
956b4b7c4e ctdb:tests: remove old now unused script test/recover.sh
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2013-11-28 07:31:12 +01:00
Martin Schwenke
609fee6135 ctdb:build: Update mkversion.sh to use samba-* tags
To test CTDB on a cluster we need to be able to build test RPMs with
relatively sane version numbers.  This is a minimal change to allow
that to happen, until CTDB is integrated into the Samba build system.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2013-11-28 07:31:12 +01:00
Martin Schwenke
bfbf62b6c9 ctdb:tests/simple: Nobody looks at /tmp/recloop.out so use /dev/null instead
Otherwise this should use mktemp, something should look at the output
and the file should be removed.  :-)

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Nov 27 20:39:00 CET 2013 on sn-devel-104
2013-11-27 20:39:00 +01:00
Martin Schwenke
eea87806ac ctdb:tests: run_tests should ignore bogus test directories
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:17 +01:00
Martin Schwenke
240f80d02b ctdb:tests: New "autotest" Makefile.in target
This needs to run with socket wrapper and needs to stop after the 1st
error.

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
2013-11-27 18:46:17 +01:00
Martin Schwenke
de864b88c3 ctdb:tests: Add -S option to support socket wrapper
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:17 +01:00
Martin Schwenke
8ca117a68e ctdb:tests: Rework unit test result filtering
Using a variable is too fragile, so use a function instead.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:17 +01:00
Martin Schwenke
9755485443 ctdb:tests: remove unused setup_nmap_output_filter()
The tests that used it have gone.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:17 +01:00
Martin Schwenke
0ae3d009f3 ctdb:tests/integration: Be more careful when killing ctdbd
Also match $TEST_VAR_DIR in the socket name.  This means that we'll
only ever kill ctdbd process belong to our own test run.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:17 +01:00
Martin Schwenke
2f5d9be754 ctdb: Update NEWS
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:17 +01:00
Amitay Isaacs
c18f3eeffb ctdb-scripts: Be careful when generating unique pids for stack traces
sort expects the data to be line based, so make it so.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:17 +01:00
Amitay Isaacs
21ef3b1cc0 ctdb-config: Simplify the default CTDB configuration file
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-programmed-with: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:17 +01:00
Amitay Isaacs
b3efb7ea51 ctdb-scripts: Replace hard-coded /var/ctdb with CTDB_VARDIR
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:17 +01:00
Amitay Isaacs
7f20b760ec ctdb-scripts: Set defaults for CTDB_DBDIR and CTDB_DBDIR_PERSISTENT
If these configuration variables are not defined, then there should
a default fallback.  This is a workaround till CTDB compile time
configuration can be accessed at runtime.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:17 +01:00
Amitay Isaacs
7a174985ff ctdb-eventscripts: Perform share check before NFS RPC checks in 60.ganesha
If NFS RPC checks do restart Ganesha, then it's possible that share
check can fail prematurely.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:17 +01:00
Martin Schwenke
0fe178eb3a ctdb-tools/ctdb: Improve error checking when parsing node string
If a node isn't numeric then it is silently converted to 0.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:17 +01:00
Martin Schwenke
44a0466ac1 ctdb-recoverd: Only respond to currently queued ipreallocated requests
Otherwise new requests can come in during the latter parts of the
takeover run when the IP allocation algorithm has already run, and the
new requests will be dequeued even though they haven't really be
processed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:16 +01:00
Martin Schwenke
a6dbe126f5 ctdb-scripts: Add an early exit to statd-callout's notify case
If $statd_state is empty then the loop will run once and print
spurious errors.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:16 +01:00
Martin Schwenke
f279a97ca4 ctdb-eventscripts: Remove the nfs_statd_update() call from 60.ganesha
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:16 +01:00
Martin Schwenke
a8f2791a9d ctdb-tests/integration: Neaten up some of the persistent database tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:16 +01:00
Amitay Isaacs
d7df54873a ctdb-tools/ctdb: Fix tstore command to generate ltdb header internally
This fixes an alignment discrepancy on 32-bit vs 64-bit platforms.

  sizeof(struct ctdb_ltdb_header) = 20  (32-bit)
                                  = 24  (64-bit)

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:16 +01:00
Martin Schwenke
14ee82263c ctdb-tests/takeover: Fix bogus test description
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:16 +01:00
Martin Schwenke
c6551132f5 ctdb-tests/simple: User sleep_for() instead of sleep
Progress...

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:16 +01:00
Martin Schwenke
2b6db9041d ctdb-tests/simple: Update persistent DB tests
* Low level DB checks should ignore the sequence number record.

* A restart is needed after messing with the RecoverPDBBySeqNum
  tunable.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:16 +01:00
Martin Schwenke
efc77ba6ac ctdb-recoverd: For persistent databases a sequence number of 0 is valid
Otherwise recovery ends up done by RSN when it is unnecessary.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:16 +01:00