summaryrefslogtreecommitdiffstats
path: root/ctdb
Commit message (Collapse)AuthorAgeFilesLines
* ctdb: improve helpfulness of debug message when taking reclock failsMichael Adam2015-01-091-1/+5
| | | | | | | | | | Print out the errno if the fcntl call. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Richard Sharpe <rsharpe@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Fri Jan 9 04:25:02 CET 2015 on sn-devel-104
* ctdb-daemon: Handle out-of-memory when setting recovery lock fileMartin Schwenke2015-01-091-8/+26
| | | | | | | | Log a message when the reclock file actually changes and avoid a memory allocation when it doesn't change. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-scripts: Don't use the GNU awk gensub() functionMartin Schwenke2015-01-094-7/+11
| | | | | | | | | | | | | This is a gawk extension and can't be used reliably if just running "awk". It is simple enough to switch to using the standard sub() and gsub() functions. The alternative is to switch to explicitly running "gawk". However, although the eventscripts aren't exactly portable, it is probably better to move closer to portability than further away. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-scripts: Try to deal with Ubuntu having /usr/sbin/serviceMartin Schwenke2015-01-091-0/+2
| | | | | | | | | Falling back to running the initscript doesn't work because it detects that upstart is being used and fails. This was observed when trying to start winbind on Ubuntu 11.04. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests: Fix tickle sniffing for IPv4Martin Schwenke2015-01-091-1/+1
| | | | | | | | | | | | tcptickle_sniff_start() assumes that if $dst contains a ': then it should use the IPv6 sniffing code. However, $dst is a socket, so has a trailing ":<port>". Strip the trailing ":<port>" before checking for ':' as a marker for an IPv6 address. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-scripts: Fix bashism in ctdbd_wrapper scriptLed2015-01-091-1/+1
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11007 Signed-off-by: Oleksandr Chumachenko <ledest@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-daemon: Use correct tdb flags when enabling robust mutex supportAmitay Isaacs2014-12-194-22/+70
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11000 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* ctdb/server: add format string checking to ctdb_tevent_logging()Stefan Metzmacher2014-12-171-1/+5
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-build: fix build without xsltprocBjörn Baumbach2014-12-151-3/+4
| | | | | | | | Check for XSLTPROC_MANPAGES before trying to build the docs. Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-build: Fix the installation of config files for top-level buildAmitay Isaacs2014-12-151-2/+7
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* ctdb-build: Fix the indentationAmitay Isaacs2014-12-151-1/+1
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* ctdb: ctdb_protocol.h references struct sockaddrVolker Lendecke2014-12-071-0/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ctdb-tests: Need to drop public IPs in kill-failover testsMartin Schwenke2014-12-053-3/+49
| | | | | | | | | | | | | | These tests simulate a dead node rather than a CTDB failure, so drop IP addresses when killing a "node" to avoid problems with duplicates. To cope with a CTDB failure a watchdog would be needed to ensure that the public IPs are dropped when CTDB dies. Let's not do that now. 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 Dec 5 23:29:39 CET 2014 on sn-devel-104
* ctdb-daemon: Gratuitous ARP equivalent for IPv6 is neighbor advertisementMartin Schwenke2014-12-051-15/+34
| | | | | | | | | Not neighbour solicitation. See: https://tools.ietf.org/html/rfc4861#section-4.4 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: More debug on SSH failureMartin Schwenke2014-12-051-4/+9
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Make tcpdump output more verboseMartin Schwenke2014-12-051-1/+1
| | | | | | | This helps with debugging. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Use ip neigh command instead of arpMartin Schwenke2014-12-054-11/+16
| | | | | | | | Extend select_test_node_and_ips() to set $test_prefix in addition to $test_ip. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Generalise the gratarp and tickle sniffing code for IPv6Martin Schwenke2014-12-051-3/+77
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Match IPv6 connections in netstat outputMartin Schwenke2014-12-051-1/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Use ping_wrapper to do relevant ping or ping6Martin Schwenke2014-12-053-3/+10
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Extend regexps to handle IPv6 address matchingMartin Schwenke2014-12-051-2/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Bracket IP addresses in NFS mounts and scp command (for IPv6)Martin Schwenke2014-12-052-2/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Try to handle IPv6 addresses for local daemonsMartin Schwenke2014-12-051-3/+11
| | | | | | | | | | | | | | | | | | | | | | | If CTDB_USE_IPV6 is set then use IPv6 addresses for nodes and public IPs. This can be useful for some simple tests. However, the node address actually needs to be on lo so that ctdbd can bind to the port on that address, so they actually need to be added as root before running tests, like this: for i in $(seq 1 10) ; do ip addr add "fc00:10::${i}/64" dev lo ; done IPv4 127.0.0.0/8 addresses are somehow magic and only one needs to be on lo so that many can be bound to. Also change the IPv4 node addresses to be (slightly) more exotic. For both IPv4 and IPv6, choose addresses that are compatible with socket wrapper. Signed-off-by: Martin Schwenke <martin@meltin.net> Signed-off-by: Amitay Isaacs <amitay@gmail.com> (socket wrapper fixes) Reviewed-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (socket wrapper fixes)
* ctdb-tests: Extend regexp to match IPv6 addressesMartin Schwenke2014-12-051-1/+3
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Bracket IP addresses in onnode (for IPv6)Martin Schwenke2014-12-051-2/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Fix IP address comparisons for IPv6 addressesAmitay Isaacs2014-12-051-2/+10
| | | | | | | | Before storing node IP address, convert into the correct abbreviated string form for IPv6 addresses. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-scripts: Wait until IPv6 addresses are not "tentative"Martin Schwenke2014-12-051-0/+23
| | | | | | | | | | | | | | | There are a few potential failure modes when adding an IPv6 address. It takes a little while of duplicate address detection to complete, so wait for a while. After a timeout, also need to check to see if duplicate address detection failed - if it did then actually drop the IP address. This really needs some careful thinking. If CTDB disappears on a node but the node's IP addresses are still on interfaces then the above failure mode could cause the takeover nodes to become banned. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-eventscripts: Specify broadcast optionally to ip addr addAmitay Isaacs2014-12-051-1/+7
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Trust vnn->interface for an IP when releasing itMartin Schwenke2014-12-051-24/+1
| | | | | | | | | | | | | | | | | | | | ctdb_sys_find_ifname() doesn't work for IPv6 addresses so don't use it. Trust the eventscript to do sanity checking on the interface. Current warnings are replaced with equivalents generated by the eventscript. The unlikely message: Public IP %s is hosted on interface %s but we have no VNN will be replaced by: WARNING: Public IP %s hosted on interface %s but VNN says __none__ which is clear enough. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Make 10.interface IPv6-safeMartin Schwenke2014-12-053-31/+65
| | | | | | | | | | | | | | | | | | | Add checking to "releaseip" and "updateip" to ensure that the given IP address is really on the given interface with the given netmask. If reality doesn't match the given arguments then believe reality. Use new function iptables_wrapper() instead of calling iptables() directly. Use new function flush_route_cache() instead of doing IPv4-specific /proc magic. Remove setting of otherwise unused variable "failed". Fix a test for which the error message has changed. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: New functions ip6tables() and iptables_wrapper()Martin Schwenke2014-12-051-1/+14
| | | | | | | | | | | ip6tables() uses the same lock as iptables(). This is done on suspicion. iptables_wrapper() takes 1st argument "inet" or "inet6", and the rest is passed to the correct iptables variant. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Add IPv6 addresses support in ip_maskbits_iface()Martin Schwenke2014-12-051-2/+9
| | | | | | | | It also prints a third word, the address family. This is either "inet" or "inet6". Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-utils: Update Nagios code to use ctdb -XMartin Schwenke2014-12-051-2/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-doc: Update examples to use ctdb -XMartin Schwenke2014-12-051-20/+20
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tool: Fix "ctdb -Y ifaces" output to have trailing delimitersMartin Schwenke2014-12-052-5/+5
| | | | | | | In the CTDB CLI tool source code and the documentation example. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Update integration tests to use ctdb -XMartin Schwenke2014-12-059-45/+45
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Update onnode and ctdb-diagnostics to use ctdb -XMartin Schwenke2014-12-057-30/+30
| | | | | | | Also update onnode unit tests. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Update eventscripts to use ctdb -X instead of ctdb -YMartin Schwenke2014-12-058-34/+34
| | | | | | | Also update associated eventscript unit tests and ctdb stub. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Add -X option for machine parsable output with separator '|'Martin Schwenke2014-12-052-0/+19
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Add -x option to specify delimiter for machine readable outputMartin Schwenke2014-12-052-4/+40
| | | | | | | | | To support this, update printm() to replace ':' in format string with options.machineseparator, which is a string but must contain a single character. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Produce machine readable output with new function printm()Martin Schwenke2014-12-051-86/+102
| | | | | | | | | printm() is a printf(3) replacement and must be used to printing any machine readable output. It currently just calls vprintf(3). Later it will change the field delimiter. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recoverd: Process all the records for vacuum fetch in a loopAmitay Isaacs2014-12-051-4/+1
| | | | | | | | | | | | | | Processing one migration request at a time is very slow and processing a batch of records can take longer than VacuumInterval. This causes subsequent vacuum fetch requests to be dropped. The dropped records can accumulate quickly and will cause the vacuum database traverse to be quite expensive. 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 Dec 5 17:06:58 CET 2014 on sn-devel-104
* ctdb-vacuum: Do not delete VACUUM MIGRATED records immediatelyAmitay Isaacs2014-12-051-0/+5
| | | | | | | | Such records should be processed by the local vacuuming daemon to ensure that all the remote copies have been deleted first. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-vacuum: Use non-blocking lock when traversing delete treeAmitay Isaacs2014-12-051-5/+1
| | | | | | | | This avoids vacuuming getting in the way of ctdb daemon to process record requests. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-vacuum: Use non-blocking lock when traversing delete queueAmitay Isaacs2014-12-051-5/+1
| | | | | | | | This avoids vacuuming getting in the way of ctdb daemon to process record requests. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-vacuum: Stagger vacuuming child processesAmitay Isaacs2014-12-051-0/+11
| | | | | | | | This prevents multiple child processes being forked at the same time for vacuuming TDBs. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-vacuum: Track time for vacuuming in database statisticsAmitay Isaacs2014-12-053-0/+12
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-scripts: Fix stack dumping when debugging hung scriptsMartin Schwenke2014-11-183-7/+12
| | | | | | | | | | | | | | | | | There are parentheses missing that stop the default pattern from matching commands with trailing garbage (e.g. "exportfs.orig"). A careful check of POSIX (and running GNU sed with --posix) suggests that "\|" isn't a supported way of specifying alternation in a regular expression. Therefore, it is clearer to switch to extended regular expressions so that this has a chance of being portable (even though the point is to print /proc/<pid>/stack, which only works on Linux). 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 Nov 18 06:37:45 CET 2014 on sn-devel-104
* ctdb-scripts: Try to restart statd after every 10 failuresMartin Schwenke2014-11-184-1/+74
| | | | | | | | | Also add and update tests for statd stack dumps. Update the existing 60.ganesha statd test to do more iterations. Duplicate the result as a new test for 60.nfs. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Add rpc.statd stack dumping to Ganesha restartMartin Schwenke2014-11-181-1/+3
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>