Martin Schwenke [Wed, 8 Jul 2015 11:23:48 +0000 (21:23 +1000)]
scripts: Support monitoring of interestingly named VLANs on bonds
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>
(Imported from commit
bc71251433ce618c95c674d7cbe75b01a94adad9)
Amitay Isaacs [Thu, 9 Jul 2015 04:55:59 +0000 (14:55 +1000)]
daemon: Fix valgrind invalid read error in db_statistics control
==20761== Invalid read of size 8
==20761== at 0x11BE30: ctdb_ctrl_dbstatistics (ctdb_client.c:1286)
==20761== by 0x12BA89: control_dbstatistics (ctdb.c:713)
==20761== by 0x1312E0: main (ctdb.c:6543)
==20761== Address 0x713b0d0 is 0 bytes after a block of size 560 alloc'd
==20761== at 0x4C27A2E: malloc (vg_replace_malloc.c:270)
==20761== by 0x5CB0954: _talloc_memdup (talloc.c:615)
==20761== by 0x11395C: ctdb_control_recv (ctdb_client.c:1146)
==20761== by 0x11BDD7: ctdb_ctrl_dbstatistics (ctdb_client.c:1265)
==20761== by 0x12BA89: control_dbstatistics (ctdb.c:713)
==20761== by 0x1312E0: main (ctdb.c:6543)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(Imported from commit
9aa90482f8ffbddf898eb8a900112f45d82f0930)
Martin Schwenke [Wed, 17 Jun 2015 05:05:30 +0000 (15:05 +1000)]
daemon: Promote debug messages about --start-as-* to NOTICE level
It is important to know when ctdbd is started with --start-as-stopped
or --start-as-disabled. Given that this only happens once it makes
sense to promote these debug items to NOTICE level.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
eb159f3ff530de8828631b04e17bf0990aed906e)
Martin Schwenke [Thu, 11 Jun 2015 05:49:25 +0000 (15:49 +1000)]
recoverd: Clear IP assignment tree on election loss
If a node was previously recovery master (say, 20 years ago) and it
becomes recovery master again then, if IP assignments have changed,
verify_remote_ip_allocation() can produce messages like the following
when called during recovery:
ctdbd: recoverd:Inconsistent IP allocation - node 0 thinks 10.1.1.1 is held by node 0 while it is assigned to node 1
When a node loses an election it should clear all data specific to it
being the recovery master.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
b234ae0a900052b03ca22efab8fa1b9e11f44ecc)
Martin Schwenke [Thu, 11 Jun 2015 05:46:27 +0000 (15:46 +1000)]
recoverd: Add new function clear_ip_assignment_tree()
This needs to be cleared to avoid stale data when a new recovery
master is elected.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
036c2a92438585ab6b99a22fcf67b67890c525f0)
Michael Adam [Fri, 12 Jun 2015 08:59:54 +0000 (10:59 +0200)]
vacuum: revert "Do not delete VACUUM MIGRATED records immediately"
This reverts commit
257311e337065f089df688cbf261d2577949203d.
That commit was due to a misunderstanding, and it
does not fix what it was supposed to fix.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
1898200481f64676e596e52dc177c8d70ca1a00c)
Stefan Metzmacher [Fri, 5 Jun 2015 08:30:39 +0000 (10:30 +0200)]
ib: make sure the tevent_fd is removed before the fd is closed
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(Imported from commit
53ff3e4f31f3debd98f9293171c023a0a406858d)
Stefan Metzmacher [Tue, 2 Jun 2015 10:43:17 +0000 (12:43 +0200)]
locking: move all auto_mark logic into process_callbacks()
The caller should not dereference lock_ctx after invoking
process_callbacks(), it might be destroyed already.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11293
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Jun 12 15:28:57 CEST 2015 on sn-devel-104
(Imported from commit
b3a18d66c00dba73a3f56a6f95781b4d34db1fe2)
Stefan Metzmacher [Tue, 2 Jun 2015 10:39:17 +0000 (12:39 +0200)]
locking: make process_callbacks() more robust
We should not dereference lock_ctx after invoking the callback
in the auto_mark == false case. The callback could have destroyed it.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11293
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
a2690bc3f4e28a2ed50ccb47cb404fc8570fde6d)
Amitay Isaacs [Tue, 2 Jun 2015 03:15:37 +0000 (13:15 +1000)]
locking: Add a comment to explain auto_mark usage
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11293
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(Imported from commit
89849c4d31c0bb0c47864e11abc89efe7d812d87)
Amitay Isaacs [Tue, 2 Jun 2015 01:25:44 +0000 (11:25 +1000)]
locking: Avoid resetting talloc destructor
Let ctdb_lock_request_destructor() take care of the proper cleanup.
If the request if freed from the callback function, then the lock context
should not be freed. Setting request->lctx to NULL takes care of that
in the destructor.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11293
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(Imported from commit
bc747030d435447e62262541cf2e74be4c4229d8)
Amitay Isaacs [Tue, 2 Jun 2015 01:15:11 +0000 (11:15 +1000)]
locking: Avoid memory leak in the failure case
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11293
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(Imported from commit
2b352ff20597b9e34b3777d35deca1bf56209f8a)
Amitay Isaacs [Mon, 1 Jun 2015 14:22:07 +0000 (00:22 +1000)]
locking: Set destructor when lock_context is created
There is already code in the destructor to correctly remove it from the
pending or the active queue. This also ensures that when lock context
is in pending queue and if the lock request gets freed, the lock context
is correctly removed from the pending queue.
Thanks to Stefan Metzmacher for noticing this and suggesting the fix.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11293
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(Imported from commit
5ae6a8f2fff5b5f4d46f496fd83f555be4b3d448)
Stefan Metzmacher [Mon, 1 Jun 2015 14:15:11 +0000 (00:15 +1000)]
locking: Set the lock_ctx->request to NULL when request is freed
The code was added to ctdb_lock_context_destructor() to ensure that
the if a lock_ctx gets freed first, the lock_request does not have a
dangling pointer. However, the reverse is also true. When a lock_request
is freed, then lock_ctx should not have a dangling pointer.
In commit
374cbc7b0ff68e04ee4e395935509c7df817b3c0, the code for second
condition was dropped causing a regression.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11293
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
752ec31bcbbfe9f5b3b1c5dde4179d69f41cb53c)
Stefan Metzmacher [Tue, 26 May 2015 14:45:34 +0000 (16:45 +0200)]
locking: Avoid memory corruption in ctdb_lock_context_destructor
If the lock request is freed from within the callback, then setting
lock_ctx->request to NULL in ctdb_lock_context_destructor will end up
corrupting memory. In this case, lock_ctx->request could be reallocated
and pointing to something else. This may cause unexpected abort trying
to dereference a NULL pointer.
So, set lock_ctx->request to NULL before processing callbacks.
This avoids the following valgrind problem.
==3636== Invalid write of size 8
==3636== at 0x151F3D: ctdb_lock_context_destructor (ctdb_lock.c:276)
==3636== by 0x58B3618: _talloc_free_internal (talloc.c:993)
==3636== by 0x58AD692: _talloc_free_children_internal (talloc.c:1472)
==3636== by 0x58AD692: _talloc_free_internal (talloc.c:1019)
==3636== by 0x58AD692: _talloc_free (talloc.c:1594)
==3636== by 0x15292E: ctdb_lock_handler (ctdb_lock.c:471)
==3636== by 0x56A535A: epoll_event_loop (tevent_epoll.c:728)
==3636== by 0x56A535A: epoll_event_loop_once (tevent_epoll.c:926)
==3636== by 0x56A3826: std_event_loop_once (tevent_standard.c:114)
==3636== by 0x569FFFC: _tevent_loop_once (tevent.c:533)
==3636== by 0x56A019A: tevent_common_loop_wait (tevent.c:637)
==3636== by 0x56A37C6: std_event_loop_wait (tevent_standard.c:140)
==3636== by 0x11E03A: ctdb_start_daemon (ctdb_daemon.c:1320)
==3636== by 0x118557: main (ctdbd.c:321)
==3636== Address 0x9c5b660 is 96 bytes inside a block of size 120 free'd
==3636== at 0x4C29D17: free (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==3636== by 0x58B32D3: _talloc_free_internal (talloc.c:1063)
==3636== by 0x58B3232: _talloc_free_children_internal (talloc.c:1472)
==3636== by 0x58B3232: _talloc_free_internal (talloc.c:1019)
==3636== by 0x58B3232: _talloc_free_children_internal (talloc.c:1472)
==3636== by 0x58B3232: _talloc_free_internal (talloc.c:1019)
==3636== by 0x58AD692: _talloc_free_children_internal (talloc.c:1472)
==3636== by 0x58AD692: _talloc_free_internal (talloc.c:1019)
==3636== by 0x58AD692: _talloc_free (talloc.c:1594)
==3636== by 0x11EC30: daemon_incoming_packet (ctdb_daemon.c:844)
==3636== by 0x136F4A: lock_fetch_callback (ctdb_ltdb_server.c:268)
==3636== by 0x152489: process_callbacks (ctdb_lock.c:353)
==3636== by 0x152489: ctdb_lock_handler (ctdb_lock.c:468)
==3636== by 0x56A535A: epoll_event_loop (tevent_epoll.c:728)
==3636== by 0x56A535A: epoll_event_loop_once (tevent_epoll.c:926)
==3636== by 0x56A3826: std_event_loop_once (tevent_standard.c:114)
==3636== by 0x569FFFC: _tevent_loop_once (tevent.c:533)
==3636== by 0x56A019A: tevent_common_loop_wait (tevent.c:637)
==3636== by 0x56A37C6: std_event_loop_wait (tevent_standard.c:140)
==3636== by 0x11E03A: ctdb_start_daemon (ctdb_daemon.c:1320)
==3636== by 0x118557: main (ctdbd.c:321)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11293
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
ee02e40e869fd46f113d016122dd5384b7887228)
Martin Schwenke [Tue, 28 Apr 2015 03:51:00 +0000 (13:51 +1000)]
scripts: Add alternative network family monitoring for NFS
For example, adding a file called nfs-rpc-checks.d/20.nfsd@udp.check
will cause NFS to be checked on UDP as well, using a separate counter.
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): Thu Apr 30 09:24:12 CEST 2015 on sn-devel-104
(Imported from commit
e359d826a42656bb02ca2ab85f0fa886a046cb58)
Amitay Isaacs [Fri, 27 Mar 2015 01:00:56 +0000 (12:00 +1100)]
tests: Switch to tcp check in rpcinfo stub
Use -T tcp instead of deprecated options -u and -t. Also, check for
localhost.
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 27 09:16:50 CET 2015 on sn-devel-104
(Imported from commit
079575d80f5b28e452abf80efc4d005fb6dac270)
Amitay Isaacs [Fri, 27 Mar 2015 01:04:03 +0000 (12:04 +1100)]
scripts: Use tcp connection for checking RPC services
It's possible for a RPC service to register only for UDP and not TCP.
Since we assume all the NFS operations are over TCP, always check RPC
services over TCP.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(Imported from commit
14886ed00c998c2ac4deb70f650584e9b371345d)
Martin Schwenke [Tue, 24 Mar 2015 09:12:51 +0000 (20:12 +1100)]
scripts: Respect $RPCMOUNTDOPTS when restarting rpc.mountd
$RPCMOUNTDOPTS is ignored when restarting rpc.statd due to the service
being unresponsive. This variable can be used to increase the number
of rpc.mountd threads when there are a lot of clients reattaching so
ignoring it can mean that only a single rpc.mount thread is started.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
130202d635d8712575fa201a12ef257f4278b862)
Amitay Isaacs [Wed, 30 Jul 2014 04:31:54 +0000 (14:31 +1000)]
daemon: Drop tunable that is no longer in use
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(Imported from commit
62ba95a9f347d2ac0e4fb53dc62b94f557e17e8b)
Amitay Isaacs [Wed, 30 Jul 2014 02:32:08 +0000 (12:32 +1000)]
recoverd: Fix typo in comment
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(Imported from commit
41ed26cbf7b81e372ea0b5cc3d96dfe217a0cf58)
Amitay Isaacs [Mon, 13 Apr 2015 04:17:12 +0000 (14:17 +1000)]
doc: Update NEWS
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Fri, 5 Sep 2014 06:09:34 +0000 (16:09 +1000)]
includes: Remove some unnecessary declarations
To accommodate removing file_lines_load() from here, drop the #ifdef
around the declaration in util.h.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
9726e17e366382776c87a8aaa63884665c604896)
Martin Schwenke [Sat, 16 Aug 2014 06:17:02 +0000 (16:17 +1000)]
logging: Move variable debug_extra from debug.*
debug_extra is CTDB-specific. Moving it will help with the
transitions to Samba's updated debug.[ch].
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
8b39141c46458974d5476b2925f2dd5d51d9180d)
Martin Schwenke [Tue, 9 Sep 2014 03:52:07 +0000 (13:52 +1000)]
logging: Factor out ctdb_logging.h from includes.h
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
97dc127b81c1923755b59aad6e735aa679af3f64)
Martin Schwenke [Fri, 15 Aug 2014 06:18:05 +0000 (16:18 +1000)]
recoverd: Change include of dlinklist.h to contain directory
This makes it consistent with the rest of the code and avoids problems
when some variant of lib/util isn't in the include path.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
0c0f323bb3e9146dc584a461b225586670fa9c2e)
Martin Schwenke [Fri, 15 Aug 2014 05:53:03 +0000 (15:53 +1000)]
tools: Move definition of timeval_delta() to tools/ctdb.c
This function is only used in this file. Samba's lib/util doesn't
have timeval_delta(), so staging a clean transition.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
6e1568149ede06d48b91bbc7ecd8c55da3b41a41)
Martin Schwenke [Fri, 15 Aug 2014 05:55:20 +0000 (15:55 +1000)]
daemon: Drop the argument to fault_setup()
Samba's version doesn't accept an argument, so this aids a smooth
transition.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
c5c74e47ee672e9e9605c5c4b96733d899b6f9b6)
Martin Schwenke [Fri, 15 Aug 2014 06:11:45 +0000 (16:11 +1000)]
util: Add extra max_size argument to file_lines_load()
This is part of a migration to Samba's lib/util. CTDB always passes 0
(i.e. no max_size) so use a simple assert() to enforce this, rather
than changing a lot of code that will be discarded anyway.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
a4e76b58a5086e1339dea53b72437ed179e6025a)
Martin Schwenke [Wed, 6 Aug 2014 06:36:58 +0000 (16:36 +1000)]
common: Move hex_decode_talloc() to the lock helper
This is the only place it is used.
After migrating to Samba's lib/util, the lock helper can be changed to
use strhex_to_data_blob().
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
94a5e28ffb53a268865666038678e78cbbb39de3)
Martin Schwenke [Thu, 4 Sep 2014 03:33:58 +0000 (13:33 +1000)]
common: Add some missing #includes
To avoid warnings when using --enable-developer, which uses
-Wmissing-prototypes.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
751ad4b62561b140b7a33d66e63907411a748501)
Martin Schwenke [Thu, 4 Sep 2014 03:31:15 +0000 (13:31 +1000)]
daemon: Move some inline declarations to header file
To avoid warnings when using --enable-developer, which uses
-Wmissing-prototypes.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
a81dccf7ad8345a1c44dc7a08e2320bd88e1aaa5)
Martin Schwenke [Thu, 4 Sep 2014 03:30:09 +0000 (13:30 +1000)]
tests: Add missing declarations caused by #define magic
Some declarations get lost because they basically get #define-d away,
so they need to be repeated after the #undef-s. Also, some functions
are introduced due the #define-s.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
6336b958d61ba6901edbaddac8bc10539c8f30ab)
Martin Schwenke [Thu, 4 Sep 2014 03:28:34 +0000 (13:28 +1000)]
tests: Mark some functions as static
To avoid warnings when using --enable-developer, which uses
-Wmissing-prototypes.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
6674949317dd4b2c1855571ea378eb6bc3b2e86c)
Martin Schwenke [Thu, 4 Sep 2014 02:34:46 +0000 (12:34 +1000)]
util: Remove util/strlist.c and references to str_util_*()
They're not used in CTDB.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
5de4a97fe941c27080061480cdd7ed8f60f4438e)
Martin Schwenke [Thu, 4 Sep 2014 01:21:24 +0000 (11:21 +1000)]
Fix some "declarations after code" problems
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
b0f9d3305850bdcce171b53e7bbbc9628a4e3c20)
Martin Schwenke [Thu, 4 Sep 2014 01:20:28 +0000 (11:20 +1000)]
util: Variables should be declared extern in headers
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
1d16555fa0ad562dcd8c4bbffaca454e68bcabbf)
Martin Schwenke [Mon, 9 Feb 2015 01:04:41 +0000 (12:04 +1100)]
Change default debug level to NOTICE (2)
This was true for the daemon until commit
b4589b954e1090a934fafd3f8e3c2cf1ed785c61.
Defaulting to ERR in the ctdb CLI tool encourages logging notices at
ERR level, so default to NOTICE instead.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
664d62b61108657d3011cf0bcbe260533c97676f)
Martin Schwenke [Fri, 6 Mar 2015 00:36:18 +0000 (11:36 +1100)]
tests: Check for readable, not executable, script
Scripts in eventscript unit tests are run under an explicitly
specified shell so they do not need to be executable. Checking that
the script is executable breaks on scripts that are installed without
the execute bit set, such as disabled eventscripts.
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 Mar 6 04:40:07 CET 2015 on sn-devel-104
(Imported from commit
f6efe0c5c2378f477e528ac9c6571a732aa2c49b)
Amitay Isaacs [Wed, 4 Mar 2015 04:36:05 +0000 (15:36 +1100)]
locking: Back-off from logging every 10 seconds
If ctdb_lock_helper cannot get a lock within 10 seconds, ctdb daemon
logs a message and invokes an external debug script. This is repeated
every 10 seconds.
In case of a contention or on a loaded system, there can be multiple
ctdb_lock_helper processes waiting to get lock on record(s). For each
lock request taking longer, ctdb daemon will flood the log every
10 seconds. Instead of logging aggressively every 10 seconds, relax
logging to every 100s and 1000s if the elapsed time has exceeded 100s
and 1000s respectively.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Mar 5 12:06:44 CET 2015 on sn-devel-104
(Imported from commit
3f97be6d0fc166ccc3c97b7f71a01a4f9adb5ddd)
Amitay Isaacs [Thu, 5 Mar 2015 02:11:46 +0000 (13:11 +1100)]
tests: Correctly cascade test failures from the end of pipes
Some eventscript unit test failures get lost because _passed=false is
set in the tail of a pipe. Add a new function test_fail() and call it
when necessary to ensure the value of _passed is set correctly.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-programmed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Mar 5 07:16:54 CET 2015 on sn-devel-104
(Imported from commit
956d1dbfd91615032de337b0d84b40c16657b8c1)
Amitay Isaacs [Thu, 5 Mar 2015 02:10:32 +0000 (13:10 +1100)]
scripts: Add a 'rm' stub so statd-callout tests work correctly
statd-callout tries to remove global files from /var/lib/nfs/statd and
this causes errors in tests. Add an rm stub that ignores attempts to
remove these files but invokes /bin/rm for anything else.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-programmed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(Imported from commit
956e51707d7ddcff060352f54d11ff42bdcc51ef)
Martin Schwenke [Fri, 13 Feb 2015 04:42:20 +0000 (15:42 +1100)]
scripts: Remove unused function nfs_statd_update()
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
50ddc2c35643389c2f249c6ad4496ab73a1bfc99)
Martin Schwenke [Fri, 13 Feb 2015 09:55:43 +0000 (20:55 +1100)]
scripts: Change statd-callout to be more scalable
Updating ctdb.tdb on each add-client, del-client and each delete
during notify was too ambitious. Persistent transactions do not
perform well enough to do this.
Revert to having add-client and del-client create touch files. Each
monitor event calls "statd-callout update" to convert touch files into
ctdb.tdb records.
Update testcases to do the "update" and add an extra test.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
500c6e194babe06b6aead7a053a9442c94db6e38)
Martin Schwenke [Thu, 26 Feb 2015 04:34:51 +0000 (15:34 +1100)]
scripts: Fix a regression in statd-callout
Commit
4638010abb116aed0c180207aaa11475277aecb7 changed from using
gensub() to gsub() in awk. However, it didn't halve the number of
backslashes in the target strings. This is necessary because
backslash is used in gensub() target strings to allow substitution of
text matching parenthesised subexpressions. This is not the case with
gsub().
So, halve the number of backslashes in the target string where gsub()
is used in statd-callout. This is the only target string broken by
changes made by the above commit
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
032441d9a2974584cde455e4dbd5cc33fe6a23c2)
Martin Schwenke [Wed, 4 Mar 2015 00:51:20 +0000 (11:51 +1100)]
tests: Unit tests for statd-callout
With improvements to unit test infrastructure to support. This
includes linking the real statd-callout into etc-ctdb/ in place of the
placeholder script.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
22602f76bc1ec91e807a8f1cd45ba6fb4c05e622)
Martin Schwenke [Fri, 27 Feb 2015 04:20:56 +0000 (15:20 +1100)]
tests: Make setup of public addresses more obvious
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
d98c7ba382189161c5b8cbbebbdfbe36f1456572)
Martin Schwenke [Fri, 27 Feb 2015 04:19:04 +0000 (15:19 +1100)]
tests: Extend eventscript unit test infrastructure for other scripts
There's so much infrastructure here that it would be a shame not to
use it for testing things like statd-callout.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
7e7c24ca7a422f2258962216b0184eda8d49827f)
Martin Schwenke [Fri, 27 Feb 2015 04:17:30 +0000 (15:17 +1100)]
tests: Support testing scripts that change directory
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
9317d82c19a0eb51ff6293d00328a5c36b063a2c)
Martin Schwenke [Fri, 27 Feb 2015 04:15:18 +0000 (15:15 +1100)]
tests: Extend ctdb stub to support "ip" with and without -X
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
2aeb518637af29da03984470d874b94dfb18e34e)
Martin Schwenke [Fri, 27 Feb 2015 04:13:23 +0000 (15:13 +1100)]
tests: Extend ctdb stub to support "ptrans", "pdelete", "catdb"
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
d057ca04a9eec0f2aa3d792da0a4648e3716685a)
Martin Schwenke [Tue, 12 Aug 2014 04:29:34 +0000 (14:29 +1000)]
test: Remove unused function check_ctdb_logfile()
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
85cc4efbff601dc25a351ec838de168eb3c7d29a)
Amitay Isaacs [Mon, 23 Feb 2015 01:38:11 +0000 (12:38 +1100)]
io: Do not use sys_write to write to client sockets
When sending messages to clients, ctdb checks for EAGAIN error code and
schedules next write in the subsequent event loop. Using sys_write in
these places causes ctdb to loop hard till a client is able to read from
the socket. With real time scheduling, ctdb daemon spins consuming 100%
of CPU trying to write to the client sockets. This can be quite harmful
when running under VMs or machines with single CPU.
This regression was introduced when all read/write calls were replaced to
use sys_read/sys_write wrappers (
c1558adeaa980fb4bd6177d36250ec8262e9b9fe).
The existing code backs off in case of EAGAIN failures and waits for an
event loop to process the write again. This should give ctdb clients
a chance to get scheduled and to process the ctdb socket.
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 Feb 24 12:29:30 CET 2015 on sn-devel-104
(Imported from commit
04a061e4d19d5bdbd8179fb0fab8b0875eec243e)
Martin Schwenke [Sat, 14 Feb 2015 01:53:08 +0000 (12:53 +1100)]
scripts: Improve messages about invalid tunables during "setup"
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 Feb 18 08:03:33 CET 2015 on sn-devel-104
(Imported from commit
dc32f11b871a7d4e8ea6fd1d01491d89103decf7)
Martin Schwenke [Sun, 8 Feb 2015 23:33:35 +0000 (10:33 +1100)]
tool: Print a warning when setting an obsolete tunable variable
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
c3706e7fb07bcb35f7d894c4e8e0c12b4a62d0db)
Martin Schwenke [Sun, 8 Feb 2015 23:32:47 +0000 (10:32 +1100)]
client: Return a value of 1 when setting obsolete tunable variable
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
54f0c39e5a33871847aa9fe2c070c7f638f54cc4)
Martin Schwenke [Sun, 15 Feb 2015 03:39:51 +0000 (14:39 +1100)]
tests: New tests for 00.ctdb "setup" event - set tunables from config
Unit test infrastructure tweaks to support.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
2c7c35377e5452e37925b970253b70875a8d7470)
Martin Schwenke [Mon, 16 Feb 2015 03:04:09 +0000 (14:04 +1100)]
scripts: Fix tunable setup code by making it shell-agnostic
All tunables set in configuration are currently set to 0 on system
where /bin/sh is dash (and perhaps other non-bash shells). dash puts
single quotes around all values in the output of the "set" builtin
command, whereas bash only puts them around values when something
needs to be quoted. Tunables always have a simple integer value so
dash will quote them and bash won't. The setup code currently passes
the raw value, including any quotes to "ctdb setvar ...". This
command does no error checking on the input, so "'1'" is converted to
0.
Change the code so that the value is determined from the shell
variable and is independent of the "set" output.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
39686f45056d942de5ebe3263a533a99ca17c79e)
Martin Schwenke [Tue, 27 Jan 2015 01:55:42 +0000 (12:55 +1100)]
recoverd: Abort when daemon can take recovery lock during recovery
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 Feb 13 09:48:15 CET 2015 on sn-devel-104
(Imported from commit
39d2fd330a60ea590d76213f8cb406a42fa8d680)
Martin Schwenke [Wed, 17 Dec 2014 09:33:19 +0000 (20:33 +1100)]
recoverd: Improve error messages on recovery lock coherence fail
When the daemon is able to take the recovery lock during recovery we
might as well guess that the cluster filesystem has a lock coherence
problem and print a more useful message. This will be more helpful to
those trying out cluster filesystems that don't have lock coherence or
that are difficult to setup.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
432d6774891eba30a959cd2d8ee8469d189c7872)
Martin Schwenke [Tue, 9 Dec 2014 02:51:27 +0000 (13:51 +1100)]
recoverd: Don't release and re-take the recovery lock
Just continue to hold it, otherwise a broken node might win an
election and grab the lock.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
48c91407abd5e34463d3a10cb6fce47ec4a0d5f6)
Martin Schwenke [Tue, 9 Dec 2014 03:50:38 +0000 (14:50 +1100)]
recoverd: Simplify ctdb_recovery_lock()
Have it just silently take or fail to take the lock, except on an
unexpected failure (where it should log an error).
This means that when it is called we need to keep the old behaviour
and explicitly release the lock. In do_recovery() the lock is
released and a message is printed before attempting to take the lock.
In the daemon sanity check the lock must be released in the error path
if it is actually taken.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
1d6ed91f5518d462ba368bca03be923428710157)
Martin Schwenke [Tue, 9 Dec 2014 03:45:08 +0000 (14:45 +1100)]
recoverd: Remove check_recovery_lock()
This has not done anything useful since commit
b9d8bb23af8abefb2d967e9b4e9d6e60c4a3b520. Instead, just check that
the lock is held.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
be19a17faf6da97365c425c5b423e9b74f9c9e0c)
Martin Schwenke [Tue, 9 Dec 2014 03:09:40 +0000 (14:09 +1100)]
recoverd: Improve logging when recovery lock file is changed
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
668ed5366237b61f0ff618f32555ce29cca5e6f3)
Martin Schwenke [Tue, 9 Dec 2014 03:07:20 +0000 (14:07 +1100)]
recoverd: New function ctdb_recovery_unlock()
Unlock the recovery lock file. This way knowledge of the file
descriptor isn't sprinkled throughout the code.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
db32a2bce54b9618fe247b33d6de81bd5f7a3b62)
Martin Schwenke [Tue, 9 Dec 2014 02:50:22 +0000 (13:50 +1100)]
recoverd: New function ctdb_recovery_have_lock()
True if this recovery daemon holds the lock.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
72701be663ddb265320a022a22130a3437bbf6bc)
Martin Schwenke [Tue, 9 Dec 2014 02:49:06 +0000 (13:49 +1100)]
daemon: Log a warning when setting obsolete tunables
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
4d3b52f1cec46f66f8d0827bc8f458cd8c86b5a5)
Martin Schwenke [Tue, 9 Dec 2014 02:47:42 +0000 (13:47 +1100)]
daemon: Mark tunable VerifyRecoveryLock as obsolete
It is pointless having a recovery lock but not sanity checking that it
is working. Also, the logic that uses this tunable is confusing. In
some places the recovery lock is released unnecessarily because the
tunable isn't set.
Simplify the logic by assuming that if a recovery lock is specified
then it should be verified.
Update documentation that references this tunable.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
d110fe231849d76ecb83378c934627dc64b74c72)
Martin Schwenke [Tue, 3 Feb 2015 03:27:11 +0000 (14:27 +1100)]
doc: Improve documentation of the recovery lock
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
a01744c08ff5b8aca4af99842acfc78a87af9297)
Martin Schwenke [Mon, 2 Feb 2015 10:21:20 +0000 (21:21 +1100)]
tests: Add new "ctdb setreclock" test
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 Feb 4 05:40:55 CET 2015 on sn-devel-104
(Imported from commit
0e89d586b2b7fa6a165a49862d2dce0d13f8b157)
Martin Schwenke [Wed, 28 Jan 2015 07:51:42 +0000 (18:51 +1100)]
daemon: Fix SET_RECLOCK_FILE regression
If the recovery lock file is unset then this dereferences a NULL
pointer. The regression is due to commit
6f1ac7af0f87d85402d708231e45a69713bba026.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
5e00673f2d95b6257a05324d2ae068004e29ff85)
Martin Schwenke [Tue, 30 Dec 2014 05:04:00 +0000 (16:04 +1100)]
scripts: Call iptables/ip6tables directly from iptables_wrapper
Drops the iptables() and ip6tables() functions and, hence, the
hardcoding of paths /sbin/iptables and /sbin/ip6tables. The latter
avoids problems on openSUSE where (for example) /usr/sbin/iptables is
used instead.
This means that locking around ip*tables commands is only done when
iptables_wrapper is called directly. This is fine because the only
conflict is when "releaseip" or "takeip"/"updateip" events are run in
parallel. The other uses in 11.natgw and 70.iscsi are in events where
there will be no collisions.
Making 11.natgw support IPv6 is unnecessary. Just put a static IPv6
address on each interface - they're plentiful.
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 28 08:29:55 CET 2015 on sn-devel-104
(Imported from commit
ab51f283e7a7f4fc82a94d39e7bb3a68e8aac554)
Martin Schwenke [Tue, 30 Dec 2014 06:07:09 +0000 (17:07 +1100)]
scripts: Error message, comment and whitespace cleanups
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
9b67c1fa3748678552400a81172d124e59d5eb79)
Martin Schwenke [Tue, 30 Dec 2014 06:03:46 +0000 (17:03 +1100)]
scripts: iSCSI eventscript should fail when PNN can't be determined
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
1a5414b6d25ed1b1abdafd8594183b84af33a6fb)
Martin Schwenke [Tue, 30 Dec 2014 06:01:21 +0000 (17:01 +1100)]
scripts: Make 70.iscsi IPv6-aware
Block iSCSI port for families of all address the node is configured to
host.
Could just unconditional add blocking using ip6tables instead.
However, this would produce errors when no IPv6 public addresses are
configured and ip6tables is not installed.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
d1bd26e5eb25aee2ce82ef178692a64073a99aa0)
Michael Adam [Thu, 8 Jan 2015 23:10:37 +0000 (00:10 +0100)]
improve helpfulness of debug message when taking reclock fails
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
(Imported from commit
a59fb322d60b7152110cc0638dd9b76dd259ac15)
Martin Schwenke [Tue, 9 Dec 2014 02:40:23 +0000 (13:40 +1100)]
daemon: Handle out-of-memory when setting recovery lock file
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>
(Imported from commit
6f1ac7af0f87d85402d708231e45a69713bba026)
Martin Schwenke [Fri, 19 Dec 2014 03:19:32 +0000 (14:19 +1100)]
scripts: Don't use the GNU awk gensub() function
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>
(Imported from commit
4638010abb116aed0c180207aaa11475277aecb7)
Martin Schwenke [Mon, 1 Dec 2014 01:21:16 +0000 (12:21 +1100)]
scripts: Try to deal with Ubuntu having /usr/sbin/service
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>
(Imported from commit
a5c5eee7d186d938c5b458cb6dbf0c78cb548b63)
Amitay Isaacs [Thu, 11 Dec 2014 02:16:47 +0000 (13:16 +1100)]
daemon: Use correct tdb flags when enabling robust mutex support
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>
(Imported from commit
e0bf5dd4566785b41ad1fa0492a9f215639f1685)
Led [Sun, 14 Dec 2014 19:06:44 +0000 (21:06 +0200)]
scripts: Fix bashism in ctdbd_wrapper script
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>
(Imported from commit
2c3672f4249a7d3453b7e82ca96b4cd666aae709)
Martin Schwenke [Sat, 20 Dec 2014 08:54:13 +0000 (19:54 +1100)]
tests: Fix tickle sniffing for IPv4
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>
(Imported from commit
82aa6bd2f27775f3fd82931d613379d5d618ef70)
Martin Schwenke [Wed, 3 Dec 2014 01:10:07 +0000 (12:10 +1100)]
tests: Need to drop public IPs in kill-failover tests
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
(Imported from commit
a07af1bb56a76d1a7ab856547c801499fc17b21b)
Martin Schwenke [Mon, 1 Dec 2014 23:57:12 +0000 (10:57 +1100)]
daemon: Gratuitous ARP equivalent for IPv6 is neighbor advertisement
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>
(Imported from commit
7f3f3b15d52c4047cbcb1c3e81f65675c8708f5f)
Martin Schwenke [Wed, 3 Dec 2014 01:09:12 +0000 (12:09 +1100)]
tests: More debug on SSH failure
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
3a2c8bb906fac4e2611a28ead6b4290ddc93de54)
Martin Schwenke [Mon, 1 Dec 2014 02:30:29 +0000 (13:30 +1100)]
tests: Make tcpdump output more verbose
This helps with debugging.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
49449f66fca52d5044d2e486570562df866adf57)
Martin Schwenke [Sat, 29 Nov 2014 09:01:20 +0000 (20:01 +1100)]
tests: Use ip neigh command instead of arp
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>
(Imported from commit
a7e7d95de9cf09652cef63d65484bbb0faa42e1c)
Martin Schwenke [Mon, 1 Dec 2014 03:07:57 +0000 (14:07 +1100)]
tests: Generalise the gratarp and tickle sniffing code for IPv6
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
0f3d9752c4677b2f3b5ee47a0b8f973b4260ef57)
Martin Schwenke [Mon, 1 Dec 2014 02:51:47 +0000 (13:51 +1100)]
tests: Match IPv6 connections in netstat output
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
3135a8c62551e09a3abada86335882a91d398747)
Martin Schwenke [Mon, 1 Dec 2014 02:50:42 +0000 (13:50 +1100)]
tests: Use ping_wrapper to do relevant ping or ping6
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
255705c030135bd54a1f7a7dc40cbf00c2fb39c9)
Martin Schwenke [Wed, 3 Dec 2014 04:58:20 +0000 (15:58 +1100)]
tests: Extend regexps to handle IPv6 address matching
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
62acf5986f52a3118ed4e3638c5ac8b1f9c0adf8)
Martin Schwenke [Wed, 3 Dec 2014 04:57:35 +0000 (15:57 +1100)]
tests: Bracket IP addresses in NFS mounts and scp command (for IPv6)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
62164ec52fd1082863bf5017a5170f74f18a07c3)
Martin Schwenke [Wed, 26 Nov 2014 10:32:22 +0000 (21:32 +1100)]
tests: Try to handle IPv6 addresses for local daemons
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)
(Imported from commit
d9d07fff34143d251b4987cdb1cff1e8b3384e64)
Martin Schwenke [Wed, 26 Nov 2014 10:31:42 +0000 (21:31 +1100)]
tests: Extend regexp to match IPv6 addresses
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
2a83b74597a3366536e1935e2e8ff23493503117)
Martin Schwenke [Fri, 28 Nov 2014 10:49:08 +0000 (21:49 +1100)]
tools: Bracket IP addresses in onnode (for IPv6)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit
2d480792e7d0b3f6628186dc77f54b708e315dd1)
Amitay Isaacs [Tue, 25 Nov 2014 01:38:23 +0000 (12:38 +1100)]
daemon: Fix IP address comparisons for IPv6 addresses
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>
(Imported from commit
e3c59d83d0ace9d7421d40d33fe917fb82bb38d8)
Martin Schwenke [Fri, 21 Nov 2014 06:33:21 +0000 (17:33 +1100)]
scripts: Wait until IPv6 addresses are not "tentative"
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>
(Imported from commit
d0b2375c3d754da3cd68e34617ab3edd36e9317b)
Amitay Isaacs [Thu, 20 Nov 2014 10:58:31 +0000 (21:58 +1100)]
eventscripts: Specify broadcast optionally to ip addr add
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(Imported from commit
d4212bd6a533b4b54b56e376a9246f2396cba253)
Martin Schwenke [Fri, 21 Nov 2014 03:52:47 +0000 (14:52 +1100)]
daemon: Trust vnn->interface for an IP when releasing it
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>
(Imported from commit
108b1be0ee62af7ecb3c775f45c540dd07a527bf)
Martin Schwenke [Fri, 21 Nov 2014 03:46:00 +0000 (14:46 +1100)]
scripts: Make 10.interface IPv6-safe
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>
(Imported from commit
6471541d6d2bc9f2af0ff92b280abbd1d933cf88)