summaryrefslogtreecommitdiff
path: root/ctdb
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-daemon: Correctly process the exit code from failed eventscriptsAmitay Isaacs2015-08-181-1/+5
| | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11431 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Wed Jul 22 15:03:53 CEST 2015 on sn-devel-104 (cherry picked from commit 00ec3c477eba50206801b451ae4eb64c12aba5db) Autobuild-User(v4-3-test): Stefan Metzmacher <metze@samba.org> Autobuild-Date(v4-3-test): Tue Aug 18 10:55:54 CEST 2015 on sn-devel-104
* ctdb-tool: Correctly print timed out event scripts outputAmitay Isaacs2015-08-181-0/+8
| | | | | | | | | | | | | | | | | | | | | The timed out error is ignored for certain events (start_recovery, recoverd, takeip, releaseip). If these events time out, then the debug hung script outputs the following: 3 scripts were executed last releaseip cycle 00.ctdb Status:OK Duration:4.381 Thu Jul 16 23:45:24 2015 01.reclock Status:OK Duration:13.422 Thu Jul 16 23:45:28 2015 10.external Status:DISABLED 10.interface Status:OK Duration:-1437083142.208 Thu Jul 16 23:45:42 2015 The endtime for timed out scripts is not set. Since the status is not returned as -ETIME for some events, ctdb scriptstatus prints -ve duration. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11431 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit 71b89b2b7a9768de437347e6678370b2682da892)
* ctdb-pmda: Add missing prototype declaration for non-static functionAmitay Isaacs2015-08-171-1/+2
| | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11434 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit 6538ba5243a043bc727039a16a7a9d5d8027fa06) Autobuild-User(v4-3-test): Stefan Metzmacher <metze@samba.org> Autobuild-Date(v4-3-test): Mon Aug 17 21:14:21 CEST 2015 on sn-devel-104
* ctdb-daemon: Check if updates are in flight when releasing all IPsMartin Schwenke2015-08-171-3/+15
| | | | | | | | | | | | | Some code involved in releasing IPs is not re-entrant. Memory corruption can occur if, for example, overlapping attempts are made to ban a node. We haven't been able to recreate the corruption but this should protect against it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11432 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 952a50485f68b3cffdf57da84aa9bb9fde630b7e)
* ctdb-banning: If node is already banned, do not run ctdb_local_node_got_banned()Amitay Isaacs2015-08-171-1/+6
| | | | | | | | | | | | This calls release_all_ips() only once on the first ban. If the node gets banned again due to event script timeout while running release_all_ips(), then avoid calling release_all_ips() in re-entrant fashion. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11432 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit 8eb04d09b119e234c88150e1dc35fc5057f9c926)
* ctdb-daemon: Ignore SIGUSR1Martin Schwenke2015-07-211-0/+1
| | | | | | | | | | | No use dying or failing eventscripts if someone sends a random SIGUSR1. 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 Jul 21 11:00:17 CEST 2015 on sn-devel-104
* ctdb-scripts: Move 60.nfs Ganesha callout to doc/examples/Martin Schwenke2015-07-214-3/+13
| | | | | | | | | | We don't expect to maintain an up-to-date copy. NFS Ganesha team might provide patches. Also move the Ganesha .check file Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Support RPC checks for tcp6 and udp6Martin Schwenke2015-07-212-2/+25
| | | | | | | This adds new configuration variable CTDB_RPCINFO_LOCALHOST6. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Return correct sequence number for CONTROL_GET_DB_SEQNUMAmitay Isaacs2015-07-141-4/+1
| | | | | | | | | | | | | | Due to the missing cast of uint64_t, CONTROL_GET_DB_SEQNUM always returned seqnum <= 256. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11398 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Tue Jul 14 13:03:25 CEST 2015 on sn-devel-104
* ctdb-scripts: Implement registration in nfs-linux-kernel-calloutMartin Schwenke2015-07-141-1/+15
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Add registration for CTDB_NFS_CALLOUT operationsMartin Schwenke2015-07-143-6/+45
| | | | | | | | This is an optimisation to avoid forking the callout for operations that are not implemented. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add some simple tests for CTDB_NFS_CALLOUTMartin Schwenke2015-07-142-0/+24
| | | | | | | One always passes, the other fails early. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Add portmapper NFS .check fileMartin Schwenke2015-07-144-9/+27
| | | | | | | Unhealthy after 1 failed attempt to contact the portmapper. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Move NFS support functions to 60.nfsMartin Schwenke2015-07-142-203/+207
| | | | | | | | Now that there is only a single NFS eventscript, other eventscripts no longer need to load all of this. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Drop configuration variable CTDB_NFS_DUMP_STUCK_THREADSMartin Schwenke2015-07-146-33/+2
| | | | | | | | | | This is now handled by passing the desired number of threads to the command specified in the dump_stuck_threads variable in .check files. Remove unused function nfs_dump_some_threads(). Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Remove unused function startstop_ganesha()Martin Schwenke2015-07-141-21/+0
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Remove 60.ganesha, replace with callout for 60.nfsMartin Schwenke2015-07-1412-366/+317
| | | | | | | | | | | | | | | | | | | | | | | This isn't a straightforward move of code from 60.ganesha to the callout. Simplifications have been made to allow better interoperation with the new NFS checking logic. The following configuration variables have been removed: CTDB_GANESHA_REC_SUBDIR Edit NFS ganesha callout to change this location CTDB_NFS_SERVER_MODE, NFS_SERVER_MODE Use CTDB_NFS_CALLOUT instead CTDB_NFS_SKIP_KNFSD_ALIVE_CHECK, CTDB_SKIP_GANESHA_NFSD_CHECK Disable the corresponding .check file instead Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Extend NFS .check files with service_check_cmd variableMartin Schwenke2015-07-143-10/+41
| | | | | | | | $service_check_cmd specifies a command to run instead of the regular rpcinfo-based check. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Remove functions startstop_nfs() and startstop_nfslock()Martin Schwenke2015-07-142-122/+0
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Remove configuration variable CTDB_MONITOR_NFS_THREAD_COUNTMartin Schwenke2015-07-148-32/+1
| | | | | | | | | This is now always enabled. If nfsd thread monitoring is not required then make CTDB_NFS_CALLOUT point to a wrapper around nfs-linux-kernel-callout that does not implement "monitor-post". Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Parameterise 60.nfs with $CTDB_NFS_CALLOUTMartin Schwenke2015-07-1416-71/+294
| | | | | | | The goal is to have a single NFS eventscript. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Remove old NFS checking codeMartin Schwenke2015-07-147-221/+0
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Switch NFS checks to new styleMartin Schwenke2015-07-1413-101/+172
| | | | | | | | | | | | | | | | Note that the 60.ganesha RPC checks need to be identical to those in the nfs-checks.d/ directory. This is because the NFS unit test infrastructure checks output against what should be produced by the checks in nfs-checks.d/. This is a minor issue, since one of the aims of this work is to remove the need for a separate 60.ganesha. In most cases configuration variable CTDB_NFS_DUMP_STUCK_THREADS is now ignored. This is now handled by passing the desired number of threads to the command specified in the service_debug_cmd variable in a .check file. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Add new NFS service checking infrastructureMartin Schwenke2015-07-141-0/+157
| | | | | | | | Provides a new extensible format for .check files, using simple variables instead of the unwieldy extended test(1) syntax now used. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Factor out new function ctdb_counter_get()Martin Schwenke2015-07-141-3/+7
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Move "ERROR:" prefix out of ctdb_check_rpc()Martin Schwenke2015-07-141-2/+2
| | | | | | | There will be warnings in addition to errors. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Clean up ctdb_check_rpc()Martin Schwenke2015-07-141-8/+7
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: NFS RPC checks should be simple and consistentMartin Schwenke2015-07-1415-42/+38
| | | | | | | | | | | | | | | | | | Change status, nlockmgr, mountd, rquotad to be unhealthy after 6 rpcinfo check failures and do a verbose restart after every 2 failures. Change 60.ganesha for consistency, since 60.ganesha tests are broken and depend on the consistency. Apart from the consistency aspect, the check infrastructure will soon be simplified so that it only allows the equivalent of "unhealthy" and "verbose restart:b" actions. Update tests to have a corresponding numbers of iterations. Run 1 extra iteration in most tests to check there are no unexpected behaviour changes after the designated number of iterations completes. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: setup_nfs() should mark nfslock as started/stoppedMartin Schwenke2015-07-141-2/+4
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Remove function iterate_test()Martin Schwenke2015-07-142-101/+4
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Remove remaining uses of iterate_test()Martin Schwenke2015-07-142-13/+16
| | | | | | | | They are contrived and hard to read. Better to just enumerate the few sub-tests in these testcases. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: New NFS test with all services up and 10 iterationsMartin Schwenke2015-07-141-0/+10
| | | | | | | | A useful baseline test to ensure that certain things (e.g. rpcinfo) aren't consistently broken. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Allow 2nd argument of nfs_iterate_test() to be nullMartin Schwenke2015-07-141-6/+17
| | | | | | | | | | | This means that required result will not be calculated on each iteration. This is useful in baseline tests where, say, all iterations should succeed and produce no output. This is useful for confirming that the eventscript and test infrastructure is working correctly. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Automate expected NFS test results instead of hard-codingMartin Schwenke2015-07-143-95/+3
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Update NFS tests to use nfs_iterate_test()Martin Schwenke2015-07-1412-27/+12
| | | | | | | ... instead of iterate_test() Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: New function nfs_iterate_test()Martin Schwenke2015-07-141-0/+55
| | | | | | | | Much clearer than using iterate_test() for this purpose. This also does failover counting by calling rpcinfo in each iteration. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: rpc_set_service_failure_response() should take RPC service nameMartin Schwenke2015-07-149-23/+33
| | | | | | | | | ... not a process name Update the tests that matter. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Don't flag failure when there are no rpcinfo check failuresMartin Schwenke2015-07-141-1/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Default fail count for rpc_set_service_failure_response() is 1Martin Schwenke2015-07-141-1/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Factor out stack dumping and background marking codeMartin Schwenke2015-07-141-28/+33
| | | | | | | This makes the code that uses it easier to modify. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Allow a new monitor event to cancel one already in progressMartin Schwenke2015-07-141-2/+6
| | | | | | | | Before commit cbffbb7c2f406fc1d8ebad3c531cc2757232690e this was possible and some users depend on this behaviour. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Improve error messages when eventscript control is cancelledMartin Schwenke2015-07-141-2/+11
| | | | | | | | | | Warn specifically about cancellation instead of printing a generic error message. Also pass back an error message for the tool - it could just rely on the status but it already looks at the error message. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Avoiding printing "(null)" on "ctdb eventscript" errorMartin Schwenke2015-07-141-1/+6
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Avoid double-free during monitor cancellationAmitay Isaacs2015-07-141-1/+1
| | | | | | | | | | The eventscript state should never be freed externally, so it should never be allocated off a temporary context. It will either be freed by the handler or in the cancellation code. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Pair-programmed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Add some 10.interfaces VLAN testsMartin Schwenke2015-07-142-0/+40
| | | | | | | One without a bond, one with a bond. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add VLAN support to the "ip link" stubMartin Schwenke2015-07-141-0/+48
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Interface number in "ip link show" stub defaults to 42Martin Schwenke2015-07-141-1/+1
| | | | | | | | It needs to have a default for the standalone case, when it is not run in a loop inside "ip addr show". Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Support monitoring of interestingly named VLANs on bondsMartin Schwenke2015-07-141-2/+26
| | | | | | | | | | | | | | | | | VLAN interfaces on bonds with a name other than <iface>.<id>@<iface> are not currently supported. That is, where the VLAN name isn't based on the underlying bond name. Such VLAN interfaces can be created with the "ip link" command, as opposed to the "vconfig" command, or by renaming a VLAN interface. This is improved by determining the underlying interface name for a VLAN from the output of "ip link". No serious attempt is made to support VLANs with '@' in their name, although this seems to be legal. Why would you do that? Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Fix regression in VLAN interface supportMartin Schwenke2015-07-141-1/+2
| | | | | | | | | | | | | | Commit 6471541d6d2bc9f2af0ff92b280abbd1d933cf88 broke support for VLAN interfaces. Releasing a public IP address depends on ip_maskbits_iface() and for a VLAN interface this will return an interface of the form <vlan>@<iface>, which can't be fed back into "ip" commands. Update ip_maskbits_iface() to drop the '@' and everything after it. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Reported-by: Jan Schwaratzki <jschwaratzki@ddn.com>
* ctdb-daemon: Remove control CTDB_CONTROL_SET_CALLAmitay Isaacs2015-07-104-40/+5
| | | | | | | | | | This has not been used for a long time. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Fri Jul 10 23:41:18 CEST 2015 on sn-devel-104