summaryrefslogtreecommitdiff
path: root/ctdb
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-tests: Catch cases where mktemp fails due to missing TMPDIRMartin Schwenke2017-03-201-2/+2
| | | | | | | | | | | | TMPDIR sometimes goes missing during autobuild. When that happens the error messages produced by CTDB tests are not very helpful. This should make it clear. 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): Mon Mar 20 08:53:02 CET 2017 on sn-devel-144
* ctdb-readonly: Avoid a tight loop waiting for revoke to completeAmitay Isaacs2017-03-171-3/+5
| | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12697 During revoking readonly delegations, if one of the nodes disappears, then there is no point re-trying revoking readonly delegation. The database needs to be recovered before the revoke operation can succeed. So retry only after a grace period. 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): Fri Mar 17 14:05:57 CET 2017 on sn-devel-144
* waf: disable-python - fix ctdb configurationIan Stakenvicius2017-03-101-2/+2
| | | | | | | | | | | | | | When ctdb is built in standalone mode, it turned off the python requirement for submodules by setting Options.options.disable_python to True before checking for its own (non-optional) python support. Ad ctdb does not need python for itself or any of the submodules it is built against, the safest solution seems to be to allow the python and python-headers checks to not find python. Signed-off-by: Ian Stakenvicius <axs@gentoo.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* ctdb-build: Fix RPM buildMartin Schwenke2017-02-271-1/+2
| | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12595 It doesn't look like recursion works for appending scripting commands. Unroll the recursion instead. 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): Mon Feb 27 03:09:27 CET 2017 on sn-devel-144
* ctdb-build: Add WAFLOCK magic to manpages targetMartin Schwenke2017-02-261-1/+2
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12595 Without this a top-level "make dist" fails to build the CTDB manpages. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-takeover: Don't release IPs from nodes where they are not knownMartin Schwenke2017-02-242-4/+10
| | | | | | | | | | | | This avoids confusing log messages like: ctdbd[21635]: releaseip called for an ip '10.1.1.1' that is not a public address Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Fri Feb 24 11:50:36 CET 2017 on sn-devel-144
* ctdb-ipalloc: Add per-IP known_on bitmapMartin Schwenke2017-02-242-0/+23
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-takeover: Fetch public IP addresses from all connected nodesMartin Schwenke2017-02-241-1/+1
| | | | | | | | | Redundant releases will be sent to all connected nodes anyway, so this is no worse. This will facilitate an improvement to avoid sending releases to nodes with no known IPs. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-takeover: Assign banning credits on failure to fetch public IPsMartin Schwenke2017-02-243-2/+11
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-takeover: Use takeover_failed() when fetching public IPs failsMartin Schwenke2017-02-241-2/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-takeover: Generalise error handling for GET_PUBLIC_IPSMartin Schwenke2017-02-241-14/+19
| | | | | | | | | As with other controls, processes the errors by hand instead of using ctdb_client_control_multi_error(). This will make it easier to add banning credits for failures. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-takeover: Only fetch available IPs from nodes with known IPsMartin Schwenke2017-02-242-1/+76
| | | | | | | A simple optimisation to avoid unnecessary communication. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-takeover: Add debug message confirming fetching of public IPsMartin Schwenke2017-02-241-0/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Populate per-node known IPs inlineMartin Schwenke2017-02-243-17/+69
| | | | | | | | | | | At the moment this is done as a post-processing step for any nodes that have no known IPs. However, this doesn't allow testing of scenarios where there no known IPs on one or more nodes. Add relevant tests. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-ipalloc: Switch noiphost to struct bitmapMartin Schwenke2017-02-243-8/+6
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-ipalloc: Switch available_on to struct bitmapMartin Schwenke2017-02-243-5/+6
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-takeover: Short circuit if fetching IPs from no nodesMartin Schwenke2017-02-241-0/+6
| | | | | | | | | The current code will fetch IP from all connected and all active nodes, so this can't happen. However, catch it anyway in case the calling code changes. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-takeover: Allocate IP list unconditionally in send functionMartin Schwenke2017-02-241-11/+8
| | | | | | | | | | | | This simplifies error handling and make failures less likely after send. This also means that num_nodes is not required in the state. Also quietly remove unused ev and client from state. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add synchronisation points in reload IPs testsMartin Schwenke2017-02-242-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | "ctdb reloadips" use of ipreallocate() can result in a spurious takeover runs. This can cause a subsequent "ctdb reloadips" to fail to disable takeover runs (due to there being one already in progress). There are various possible improvements but a proper fix probably requires a protocol change. That would mean receiving an ACK for a takeover run request to indicate that the request will be processes and then a broadcast to indicate a completed takeover run. There are various other partial fixes (e.g. de-duping queued takeover run requests against those in the in-progess queue) and workarounds (e.g. always do a double ipreallocate() in the tool, which should absorb the spurious takeover run). However, this is unlikely to be a real-world problem. Real use cases should not involve repeatedly reloading the IP configuration. Instead, work around the problem of flaky tests by manually adding "ctdb sync" commands to cause extra no-op takeover runs. These should not add spurious takeover runs and will create synchronisation points to help avoid the issue. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-doc: Update instructions in example NFS Ganesha call-outMartin Schwenke2017-02-241-11/+8
| | | | | | | | In particular, make them reflect the recent advice in ctdbd.conf(5) about setting CTDB_NFS_CHECKS_DIR. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-doc: Fix monitoring bug in example NFS Ganesha call-outMartin Schwenke2017-02-241-3/+3
| | | | | | | | There is no "check" method. This was an error in the original example. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-doc: Fix shellcheck warning in example NFS ganesha call-outMartin Schwenke2017-02-241-6/+12
| | | | | | | | | | | In ctdb/doc/examples/nfs-ganesha-callout line 216: for node in `ls ${GANSTATEDIR}`; do ^-- SC2045: Iterating over ls output is fragile. Use globs. ^-- SC2006: Use $(..) instead of legacy `..`. ^-- SC2086: Double quote to prevent globbing and word splitting. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-doc: Make example NFS Ganesha call-out almost pass shellcheckMartin Schwenke2017-02-241-21/+21
| | | | | | | | | | | This call-out is referred to in the wiki as an example, so make it as clean as possible. All the changes here are trivial. There is still one failure, which is slightly non-trivial, so it can be fixed in a separate commit. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-doc: Whitespace fixes in example NFS ganesha calloutMartin Schwenke2017-02-241-154/+159
| | | | | | | | Fix some whitespace errors, reindent the whole script and wrap lines where needed. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-utils: CID 1343331 Unchecked return value from library (CHECKED_RETURN)Martin Schwenke2017-02-241-1/+1
| | | | | | | Explicitly ignore keyboard input in ping_pong. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: CID 1396883 Dereference null return value (NULL_RETURNS)Martin Schwenke2017-02-241-0/+1
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12592 The fix in 08e03fa7f5fdc7f988fbbb26929e8c5727f36c2e is incomplete. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb: Fix posible NULL deref in logging_init()Andreas Schneider2017-02-231-0/+7
| | | | | | | | | Found by covscan. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12592 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ctdb-build: Add make target for generating manpagesAmitay Isaacs2017-02-231-0/+3
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12595 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-build: Split dist() target to generate manpages separatelyAmitay Isaacs2017-02-231-17/+27
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12595 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* Correct "acheive" typos.Chris Lamb2017-02-221-1/+1
| | | | | | Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* Correct "paramter" typos.Chris Lamb2017-02-221-1/+1
| | | | | | Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* Correct "overriden" typos.Chris Lamb2017-02-221-1/+1
| | | | | | Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* Correct "occured" typos.Chris Lamb2017-02-223-3/+3
| | | | | | Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* Correct "supressed" typo.Chris Lamb2017-02-222-3/+3
| | | | | | Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* Correct "recived" typo.Chris Lamb2017-02-221-1/+1
| | | | | | Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* Correct "progess" typo.Chris Lamb2017-02-221-1/+1
| | | | | | Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* Correct "emty" typo.Chris Lamb2017-02-221-1/+1
| | | | | | Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* Correct "doesnt" typos.Chris Lamb2017-02-221-2/+2
| | | | | | Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* ctdb: Do not leak fd handle in control_restoredb()Andreas Schneider2017-02-171-0/+1
| | | | | | | | | | | | Found by covscan. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12592 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Feb 17 18:43:16 CET 2017 on sn-devel-144
* ctdb-daemon: Use sock_clean() to remove stale socketsAmitay Isaacs2017-02-172-14/+3
| | | | | | | | 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): Fri Feb 17 14:45:10 CET 2017 on sn-devel-144
* ctdb-common: Refactor code to remove a stale socketAmitay Isaacs2017-02-172-0/+16
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-locking: Remove unnecessary global variableAmitay Isaacs2017-02-171-8/+5
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-scripts: Initialise CTDB_NFS_CALLOUT in statd-calloutMartin Schwenke2017-02-161-0/+1
| | | | | | | | | | | | | | | | | | | | Some configurations may set CTDB_NFS_CALLOUT to the empty string. They may do this if they allow a choice of NFS implementations. In this case the default call-out for Linux kernel NFS should be used. However, statd-callout does not call nfs_callout_init() to set the default. Therefore, statd-callout is unable to restart the lock manager, so the grace period is never entered. statd-callout must call nfs_callout_init() before trying to restart the lock manager. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12589 Signed-off-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 Feb 16 09:21:03 CET 2017 on sn-devel-144
* ctdb-tests: Add more comm testsAmitay Isaacs2017-02-162-36/+283
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12580 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Fix use-after-free error in comm_fd_handler()Amitay Isaacs2017-02-161-6/+40
| | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12580 comm_write_send() creates a new tevent_req and adds it to the queue of requests to be processed. If this tevent_req is freed, then the queue entry is not removed causing use-after-free error. If the tevent_req returned by comm_write_send() is freed, then that request should be removed from the queue and any pending actions based on that request should also be removed. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb: Only build test_mutex_raw.c on LinuxVolker Lendecke2017-02-151-1/+1
| | | | | | | | This is pretty glibc on Linux specific. FreeBSD 11 also has robust mutexes and can't build this. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ctdb-build: Install CTDB tests correctly from toplevelAmitay Isaacs2017-02-021-1/+6
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12547 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): Thu Feb 2 08:25:57 CET 2017 on sn-devel-144
* ctdb-common: ioctl(.. FIONREAD ..) returns an int valueAmitay Isaacs2017-02-011-1/+2
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12549 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Feb 1 14:29:14 CET 2017 on sn-devel-144
* ctdb-tests: Use replace headers instead of system headersAmitay Isaacs2017-01-311-17/+7
| | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12469 This ensures that PTHREAD_MUTEX_ROBUST, pthread_mutexattr_setrobust() and pthread_mutex_consistent() are always defined. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Jan 31 11:57:01 CET 2017 on sn-devel-144
* ctdb-tests: Do not build mutex test if robust mutexes are not supportedAmitay Isaacs2017-01-311-4/+5
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12469 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org>