summaryrefslogtreecommitdiff
path: root/ctdb
Commit message (Collapse)AuthorAgeFilesLines
* ctdb: Use talloc_report_str in ctdbVolker Lendecke2015-08-202-27/+17
| | | | | | | This fixes CID 1125620 Insecure temporary file Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* ctdb: Fix some clang uninitialized errorsVolker Lendecke2015-08-191-4/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* ctdb: Fix the build on FreeBSD 10.1Volker Lendecke2015-08-191-1/+1
| | | | | | | We get sockaddr_in directly in parse_ipv4 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* ctdb-tests: Add a policy routing test with misconfigurationMartin Schwenke2015-08-072-0/+36
| | | | | | | | | | | To support this, extend the "ip route add" stub to detect duplicate routes. 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): Fri Aug 7 08:37:38 CEST 2015 on sn-devel-104
* ctdb-tests: Make fake gateway different to actual public IPsMartin Schwenke2015-08-071-2/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Improve error handling for 50.samba testparm failureMartin Schwenke2015-08-077-12/+151
| | | | | | | | Also add tests. Update testparm stub to fake error and timeout. Add timeout stub. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-pmda: Add missing prototype declaration for non-static functionAmitay Isaacs2015-08-071-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>
* ctdb-daemon: Reset database statistics when resetting statisticsAmitay Isaacs2015-08-073-0/+23
| | | | | | | | When the ctdb statistics is reset, reset per database statistics to keep it consistent with ctdb statistics. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-system: Remove unused system specific callsAmitay Isaacs2015-08-077-297/+0
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Check if updates are in flight when releasing all IPsMartin Schwenke2015-07-291-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. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-banning: If node is already banned, do not run ctdb_local_node_got_banned()Amitay Isaacs2015-07-291-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. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Return the correct status sent from the daemonAmitay Isaacs2015-07-291-1/+1
| | | | | | | | If a control fails and error message is set, the returned status of the control is always set to -1 ignoring the status passed by the daemon. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Correctly process the exit code from failed eventscriptsAmitay Isaacs2015-07-221-1/+5
| | | | | | | | 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
* ctdb-tool: Correctly print timed out event scripts outputAmitay Isaacs2015-07-221-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. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* 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>