summaryrefslogtreecommitdiff
path: root/ctdb
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-pmda: Use modified API in pcp library 4.0Amitay Isaacs2018-03-022-9/+22
| | | | | | | | | | | | Support backward compatibility by checking for __pmID_int type, which was previously in <pcp/impl.h>. In the new version, this type is not defined anymore and there is no need to include <pcp/impl.h>. 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 2 00:38:52 CET 2018 on sn-devel-144
* ctdb-tests: Generalise SM_NOTIFY output format in statd-callout testsMartin Schwenke2018-03-012-6/+42
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Clean up statd-calloutMartin Schwenke2018-03-011-46/+53
| | | | | | | | This means there will be 2 loops reading the data but the code flow is much more obvious. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Exit on statd-callout sub-test failureMartin Schwenke2018-03-011-2/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Avoid no-op "ctdb ptrans" callMartin Schwenke2018-03-011-3/+7
| | | | | | | | | | | | | | This causes unnecessary g_lock activity and overhead. This could be optimised in ctdb.c:control_ptrans(). However, that makes the code more complex. Let's only do that if we get more potentially no-op uses. Note no optimisation is needed in the "notify" case because there is already an early exit if there are no items. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Reindent parts of onnodeMartin Schwenke2018-03-011-75/+75
| | | | | | | | No functional changes. Best viewed with diff/show -w to avoid whitespace differences. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Remove test hooks from onnodeMartin Schwenke2018-03-011-14/+0
| | | | | | | | | | | CTDB_NODES_SOCKETS is no longer used. The test code uses ONNODE_SSH to run a fake ssh client. Leave indenting sloppy and fix it in the next commit so that this change is clear. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Use fake ssh script for onnode in local daemons testsMartin Schwenke2018-03-011-0/+3
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add fake ssh command for local daemons testsMartin Schwenke2018-03-011-0/+42
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Revisit stray file descriptor avoidance in onnodeMartin Schwenke2018-03-011-3/+3
| | | | | | | | | | | Commit 635da189dccef6516d490c228407b9987986c578 fixed a problem where a stray file descriptor leaked into a subshell. Explicitly close the file descriptor at the outermost possible point rather than relying on fakessh() to do it. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Introduce a variable to hold the ssh commandMartin Schwenke2018-03-011-2/+3
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Change onnode to use ONNODE_SSH and ONNODE_SSH_OPTSMartin Schwenke2018-03-012-19/+19
| | | | | | | | | Instead of more generic SSH and EXTRA_SSH_OPTS. Quietly drop reference to rsh in case it gives anyone ideas. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Drop debugging variable CTDB_EXTERNAL_TRACEMartin Schwenke2018-03-016-39/+0
| | | | | | | | This was an attempt to debug an unexpected situation. It never triggered, so delete it and all supporting code. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Avoid creating files in /tmp.Martin Schwenke2018-03-011-1/+2
| | | | | | | | | Temporary test data should all go somewhere under TEST_VAR_DIR instead of in the global /tmp. The existing mktemp could be changed so the data goes into the test directory but mktemp is overkill in this case. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Check for errors when adding stubs/ subdirectory to PATHMartin Schwenke2018-03-011-5/+4
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Clean up PATH setting for stubs/ subdirectoryMartin Schwenke2018-03-012-18/+16
| | | | | | | | | | | | Drop unnecessary PATH setting in rc.local. The functions file no longer sets PATH so setting it here is unnecessary. Fix a comment referencing this PATH setting. Given EVENTSCRIPTS_PATH is no longer used, use a more obvious variable name and fail on missing stubs/ subdirectory. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Drop unneccessary unset of variableMartin Schwenke2018-03-011-3/+0
| | | | | | | | The comment is incorrect. This is only set when running simple tests on local daemons. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Use consistent NAT gateway nodes fileMartin Schwenke2018-03-013-8/+5
| | | | | | | | | | Using a different file each time causes the event script to believe that the configuration has changed even though only the node states have changed. Change this to stop the tests from doing something unexpected. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Fix a double-typo bugMartin Schwenke2018-03-011-2/+2
| | | | | | | | Amazingly, the code actually works! Understanding why is homework for real shell experts, who are not necessarily created ==! Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Add default for public addresses file where missingMartin Schwenke2018-03-012-2/+2
| | | | | | | This makes it consistent with the rest of the script code. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Do not use ctdb_service_reconfigure() for policy routingMartin Schwenke2018-03-011-12/+7
| | | | | | | | This is an unconditional reconfiguration so skip the unnecessary logic. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-packaging: Package event scripts via a wildcardMartin Schwenke2018-03-011-19/+1
| | | | | | | This avoids churn as event scripts are renamed and moved about. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-packaging: Make the ctdb package own more directoriesMartin Schwenke2018-03-011-0/+3
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Set test timeout to an hourMartin Schwenke2018-02-081-1/+1
| | | | | | | | | | | | | | | | The current 10 minute timeout is causing autobuild failures in some environments. This timeout is simply meant to stop a test run from hanging indefinitely due to a broken test. A 1 hour timeout is better than no timeout. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Feb 8 04:42:56 CET 2018 on sn-devel-144
* ctdb-common: Optimize sock_queue's memory managamentSwen Schillig2018-01-301-1/+14
| | | | | | | | | | | Make use of talloc pools for the sock_queue's memory requirements. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Tue Jan 30 18:12:32 CET 2018 on sn-devel-144
* ctdb-common: Remove sock_queue_destructorSwen Schillig2018-01-301-11/+0
| | | | | | | | | The sock_queue_destructor is not needed. The performed tasks will be performed automatically. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Return if packet size is zeroSwen Schillig2018-01-301-0/+1
| | | | | | | | | Prevent further processing of sock_queue_process if the received packet size is zero. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Fix a typoMartin Schwenke2018-01-241-1/+0
| | | | | | | | | | | | | | | This typo causes the script to be run with the default shell. If this is not bash then the shell will fail to parse integration.bash. This is a regression caused by commit c607989d91b64d837253aae794b1a3d6013eb3e0. Clearly nobody has run this test on Debian for a long time. :-( 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): Wed Jan 24 10:28:52 CET 2018 on sn-devel-144
* ctdb-tests: Add a UNIT pseudo-test-suiteMartin Schwenke2018-01-241-5/+27
| | | | | | | This runs all of the unit tests. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Only use socket-wrapper for simple, local daemon testsMartin Schwenke2018-01-243-11/+11
| | | | | | | | The run_tests.sh -S option now takes the path to the socker-wrapper shared library. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add timeout for individual tests, default is 10 minutesMartin Schwenke2018-01-241-2/+7
| | | | | | | | | This will cause a hung test to time out and fail rather than letting a test run hang indefinitely. Some tests can take 5 minutes to run, so 10 minutes should be plenty. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* build: deal with recent glibc sunrpc header removalGünther Deschner2018-01-221-1/+1
| | | | | | | | | | | | | | | We need to rely on libtirpc or libntirpc to be around in that case. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238 BUG: https://bugzilla.samba.org/show_bug.cgi?id=10976 Guenther Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* ctdb-tests: Avoid race condition in sock_daemon test 5Amitay Isaacs2018-01-221-9/+17
| | | | | | | | This test fails when it takes more than 10s to run. This can occur when the system is loaded and socket-wrapper is used. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* systemd: Add documentation to Unit filesMathieu Parent2018-01-141-0/+1
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12402 Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* doc/ctdb: fix two typosBjörn Baumbach2017-12-191-2/+2
| | | | | | | Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ctdb/tcp/tcp_connect.c set socket close on execGary Lockyer2017-12-181-0/+1
| | | | | | | | | | Set SOCKET_CLOEXEC on the sockets returned by accept. This ensures that the socket is unavailable to any child process created by system(). Making it harder for malicious code to set up a command channel, as seen in the exploit for CVE-2015-0240 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ctdb/server/ctdb_daemon.c set socket close on execGary Lockyer2017-12-181-0/+1
| | | | | | | | | | Set SOCKET_CLOEXEC on the sockets returned by accept. This ensures that the socket is unavailable to any child process created by system(). Making it harder for malicious code to set up a command channel, as seen in the exploit for CVE-2015-0240 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ctdb-recovery-helper: Deregister message handler in error pathsAmitay Isaacs2017-12-131-4/+12
| | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13188 If PULL_DB control times out but the remote node is still sending the data, then the tevent_req for pull_database_send will be freed without removing the message handler. So when the data is received, srvid handler will be called and it will try to access tevent_req which will result in use-after-free and abort. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Add async version for ctdb_client_init()Amitay Isaacs2017-12-132-66/+166
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Avoid using void ** argumentAmitay Isaacs2017-12-132-3/+3
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-build: Apply dependency to correct subsystemAmitay Isaacs2017-12-131-2/+2
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Send STARTUP control after startup eventAmitay Isaacs2017-11-302-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13154 STARTUP control is primarily used to synchronise tcp tickles from running nodes to a node which has just started up. Earlier STARTUP control was sent (using BROADCAST_ALL) after setup event. Once the other nodes in the cluster connected to this node, the queued up messages would be sent and the tcp tickles would get synchronised. Recent fix to drop messages to disconnected or not-yet-connected nodes, the STARTUP control was never sent to the remote nodes and the tcp tickles did not get synchronised. To fix this problem send the STARTUP control (using BROADCAST_CONNECTED) after startup event. By this time all the running nodes in the cluster are connected. 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 Nov 30 15:29:48 CET 2017 on sn-devel-144
* ctdb-takeover: Send tcp tickles immediately on STARTUP controlAmitay Isaacs2017-11-301-8/+7
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13154 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-takeover: Refactor code to send tickle lists for all public IPsAmitay Isaacs2017-11-301-17/+27
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13154 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* build: Move socket_wrapper to third_partyAndreas Schneider2017-11-251-6/+15
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* ctdb-eventd: Simplify eventd codeAmitay Isaacs2017-11-241-166/+17
| | | | | | | | 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 Nov 24 15:49:46 CET 2017 on sn-devel-144
* ctdb-common: Add special monitor handling to run_event abstractionAmitay Isaacs2017-11-241-10/+135
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Make sure child processes are waited on after terminationAmitay Isaacs2017-11-241-2/+11
| | | | | | | | | Looks like the if a process holding fcntl lock (on pid file) is killed, then the lock is not released till the process is reaped using either wait() or waitpid(). Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Add async version of shutdown in sock_daemonAmitay Isaacs2017-11-213-9/+110
| | | | | | | | 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): Tue Nov 21 08:58:45 CET 2017 on sn-devel-144
* ctdb-common: Add async version of reconfigure in sock_daemonAmitay Isaacs2017-11-214-0/+161
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>