summaryrefslogtreecommitdiffstats
path: root/ctdb
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-eventscripts: New configuration variable CTDB_GANESHA_REC_SUBDIRMartin Schwenke2014-06-112-3/+20
| | | | | | | | | | | | | | Backup and restore of the cluster filesystem can upset the operation of 60.ganesha by changing the contents of this subdirectory. Allow this subdirectory to be configured to a subdirectory that is ignored by backup and restore processes. 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 Jun 11 09:29:22 CEST 2014 on sn-devel-104
* ctdb:server: fix DEBUG message for wrong event script options.Michael Adam2014-06-051-2/+3
| | | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Thu Jun 5 19:51:36 CEST 2014 on sn-devel-104
* ctdb-tools-ctdb: Make natgwlist and lvsmaster more resilientMartin Schwenke2014-05-294-33/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent changes have caused these commands to attempt to get capabilities from all nodes before doing further filtering. This means that capabilities are unnecessarily fetched from nodes that are unlikely to be the master. If such a node does not answer the control then many nodes can fail to calculate the master node. In the case of natgwlist this will cause "monitor" events to fail resulting in unhealthy nodes. Restore the behaviour where capabilities are only fetched for a node that will be the master if it has the desired flags. Although this masks a problem where a connected node is not replying, it can help to avoid an outage in some cases. Add supporting tests and infrastructure. Infrastructure just lets a timeout be faked - just for ctdb_ctrl_getcapabilities_stub() so far. First test checks that this infrastructure works if the first node times out in natgwlist. Second test checks the case worked around by the above fix - that is, no failure when a node with PNN beyond the NATGW master can time out. 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 May 29 05:59:37 CEST 2014 on sn-devel-104
* ctdb-ib: Make infiniband transport compile againAmitay Isaacs2014-05-295-10/+12
| | | | | | | | | | | | | | | | | | Update included header files and fix compilation warnings. ib/ibwrapper.c: In function ‘ibw_stop’: ib/ibwrapper.c:1015:17: warning: comparison between ‘enum ibw_state_ctx’ and ‘enum ibw_state_conn’ [-Wenum-compare] if (ctx->state==IBWC_ERROR || ctx->state==IBWC_CONNECTED) { ^ ib/ibwrapper.c:1015:43: warning: comparison between ‘enum ibw_state_ctx’ and ‘enum ibw_state_conn’ [-Wenum-compare] if (ctx->state==IBWC_ERROR || ctx->state==IBWC_CONNECTED) { The current logic just seems wrong. The context of this line and the error checking in ibw_disconnect() suggest that these comparisons should use p->state rather than ctx->state, so do that. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-pmda: Do not hardcode include pathsAmitay Isaacs2014-05-291-4/+4
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tools-ctdb: scriptstatus should not count disabled scriptsMartin Schwenke2014-05-281-1/+7
| | | | | | | | | | | | | | | | | | script_status->num_scripts is used as the count in this message: "%d scripts were executed last %s cycle\n" However, script_status->num_scripts includes disabled scripts, which are never actually executed. Instead, count the number of scripts that aren't disabled and make the message print that. 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 May 28 02:27:48 CEST 2014 on sn-devel-104
* ctdb-build: Move internal include files in a separate directoryAmitay Isaacs2014-05-274-1/+2
| | | | | | | | This will allow to build clustered samba with built-in ctdb tree rather than needing to install CTDB first. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-build: Build ctdb_version.h before compiling files that include itAmitay Isaacs2014-05-271-0/+3
| | | | | | | | This will correctly build ctdb_version.h before other targets when running make -j. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-daemon: Move a ZERO_STRUCT() to a better placeMartin Schwenke2014-05-051-3/+12
| | | | | | | | | | | | | | It might as well be near where it is used. Add a comment explaining it. Also add/update comments at the top of the RELEASE_IP and TAKEOVER_IP loops to explain what is happening. 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 May 5 06:20:39 CEST 2014 on sn-devel-104
* ctdb-eventscripts: Add check for invalid policy routing configurationMartin Schwenke2014-05-053-0/+33
| | | | | | | | | | | | | The range CTDB_PER_IP_ROUTING_TABLE_ID_LOW..CTDB_PER_IP_ROUTING_TABLE_ID_HIGH should not include 253-255. Otherwise policy routing may overwrite the default system routing tables. Add some corresponding tests. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-eventscripts: Update comment in 11.routingMartin Schwenke2014-05-051-8/+13
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-eventscripts: Don't check if $iface is emptyMartin Schwenke2014-05-051-13/+15
| | | | | | | | | | | | | This is the loop variable. It can't be empty, especially given the way the list is built. This must have survived from an earlier version of the script. Given that there are whitespace changes associated with the above, clean-up the "virtio_net" avoidance check so that it reads less like line-noise. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb: Fix a comment typoVolker Lendecke2014-04-301-1/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Apr 30 21:05:09 CEST 2014 on sn-devel-104
* ctdb-recoverd: Detach database from recovery daemonAmitay Isaacs2014-04-233-0/+58
| | | | | | | | | | | | As part of vacuuming, recoverd attaches to databases to migrate records. When detaching a database from main daemon, it should be removed from recovery daemon also. 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): Wed Apr 23 17:05:45 CEST 2014 on sn-devel-104
* ctdb-tests: Add test for re-attaching detached databaseAmitay Isaacs2014-04-231-0/+33
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tools/ctdb: Unlock records before closing tdb databaseAmitay Isaacs2014-04-231-2/+2
| | | | | | | | | Now freeing ctdb_db context will close the tdb database. So make sure all the locks are released (by freeing record handles or memory context from which record handles are allocated) before freeing ctdb_db context. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-client: Talloc tdb_wrap off ctdb_db_contextAmitay Isaacs2014-04-231-1/+2
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-daemon: Talloc tdb_wrap off ctdb_db_contextAmitay Isaacs2014-04-231-1/+1
| | | | | | | | This will ensure that when ctdb_db is freed, it will close the tdb database. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests: Update "ctdb detach" testMartin Schwenke2014-04-231-15/+56
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tools/ctdb: Detach databases only if all nodes disallow client accessAmitay Isaacs2014-04-232-0/+68
| | | | | | | | | | | This makes sure that AllowClientDBAttach is set to 0 before detaching any databases. If someone enables the tunable between checking of tunable and actual detaching of databases, then they deserve what they get. :-) Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-daemon: Do not allow database detach if AllowClientDBAttach=1Amitay Isaacs2014-04-231-3/+4
| | | | | | | | This avoids the server detaching a database if clients are allowed to connect to databases. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* lib-util: rename memdup to smb_memdup and fix all callersBjörn Baumbach2014-04-161-1/+1
| | | | | Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Volker Lendecke <vl@samba.org>
* auth: Remove plaintext OSF1 password supportAndrew Bartlett2014-04-151-3/+0
| | | | | | | | The WAF build does not have the code to detect getprpwnam on which this is based, and so this is dead code. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* ctdb-eventscripts: CTDB_NATGW_PUBLIC_* optional on slave-only nodesMartin Schwenke2014-04-149-17/+142
| | | | | | | | | | | | | | | | | | | | | | | | | Commit 4ee4925d416a86341bd76c11fa99ec9173682a1d forgot about CTDB_NATGW_SLAVE_ONLY so it introduces an incorrect failure when this is set, and CTDB_NATGW_PUBLIC_IFACE or CTDB_NATGW_PUBLIC_IP is unset. Relax the sanity check to see if CTDB_NATGW_SLAVE_ONLY is set. Update the documentation to explicitly state that CTDB_NATGW_PUBLIC_IFACE and CTDB_NATGW_PUBLIC_IP are optional and unused if CTDB_NATGW_SLAVE_ONLY is set. It would be possible to insist that CTDB_NATGW_PUBLIC_IFACE and CTDB_NATGW_PUBLIC_IFACE should be unset in that case. However, it is more reasonable to allow consistent configuration across nodes except with some nodes configured slave-only. Add tests, update infrastructure and fix a thinko in the stub's "natgwlist" implementation. 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): Mon Apr 14 06:06:49 CEST 2014 on sn-devel-104
* ctdb-tools-ctdb: Drop disconnected nodes when filtering by capabilityMartin Schwenke2014-04-143-3/+56
| | | | | | | | | | | | | | | | | | | | | Commit ba69742ccd822562ca2135d2466e09bf1216644b missed the point of filtering disconnected nodes while limiting the nodemap to those in the NAT gateway group. It was really to avoid trying to fetch capabilities from disconnected nodes. This should be explicitly done in filter_nodemap_by_capabilities(), otherwise "ctdb natgwlist" simply fails when there is a disconnected node. Note that the alternate solution where filter_nodemap_by_flags() is called before filter_nodemap_by_capabilities() would not be not correct. Filtering on flags first can produce a "healthier" set of nodes where none of them have the NAT gateway capability. Also extend stub for ctdb_ctrl_getcapabilities() to fail when trying to get capabilities from a disconnected node and add a corresponding test to confirm that "ctdb natgwlist" is no longer broken. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add a simple test for "ctdb detach"Amitay Isaacs2014-04-141-0/+85
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-doc: Remove commands that have been deletedAmitay Isaacs2014-04-141-64/+0
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-doc: Add "ctdb detach" and update "ctdb attach"Amitay Isaacs2014-04-141-5/+34
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tools/ctdb: Add ctdb detach command to detach databasesAmitay Isaacs2014-04-141-0/+40
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Add client code to detach a databaseAmitay Isaacs2014-04-142-0/+20
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Add control CTDB_CONTROL_DB_DETACHAmitay Isaacs2014-04-144-0/+91
| | | | | | | This detaches specified database from all the nodes. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Always update database priority cluster wideAmitay Isaacs2014-04-074-17/+17
| | | | | | | | | | | | | Database priority is a global property and all the nodes should have the priority set for the databases. Just setting priority on one node can lead to problems in the recovery as a database can be frozen at wrong priority and then freezing database would not succeed. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Mon Apr 7 14:06:26 CEST 2014 on sn-devel-104
* dlinklist: Fix a typoVolker Lendecke2014-04-022-2/+2
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Wed Apr 2 17:11:37 CEST 2014 on sn-devel-104
* ctdb:daemon avoid goto ctdb_remove_orphaned_ifaces()Gregor Beck2014-04-011-9/+5
| | | | | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Apr 1 02:59:05 CEST 2014 on sn-devel-104
* ctdb:daemon take a shortcut in all_nodes_are_disabled()Gregor Beck2014-04-011-5/+4
| | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-readonly: Do not use hard-coded value for readonly revoke timeoutAmitay Isaacs2014-03-311-2/+2
| | | | | | | | | | | | In case of control timeouts, readonly revoke code currently aborts. This needs to be fixed. Meanwhile, using control_timeout instead of 5 seconds, increases the timeout to 60 seconds. 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): Mon Mar 31 07:20:48 CEST 2014 on sn-devel-104
* ctdb-tests: Do not mix bool and int data typesAmitay Isaacs2014-03-281-1/+1
| | | | | | | | 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 Mar 28 07:56:18 CET 2014 on sn-devel-104
* ctdb-tests: Use ctdb_fetch_lock instead of ctdb_fetch_lock_readonlyAmitay Isaacs2014-03-281-1/+1
| | | | | | | | This will test that ctdb_fetch_lock correctly revokes readonly delegations. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: ctdb_fetch_lock should check for readonly delegationsAmitay Isaacs2014-03-281-0/+15
| | | | | | | | When readonly delegations were added, ctdb_fetch_lock code should have been modified to include the check for readonly flags. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Fix and extend read-only records testMartin Schwenke2014-03-281-93/+123
| | | | | | | | | | | | | This test currently counts the number of read-only-enabled databases and expects there to only be 1. It fails when there are existing databases with read-only already enabled. Instead, check just the test database. Clean up the test by adding some functions to check for precisely the read-only flags that should be set on a node after each operation. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add a new NFS tickle testMartin Schwenke2014-03-282-4/+102
| | | | | | | | | This one ensures that a newly started node gets an up-to-date tickle list. Tweak some of the integration test functions to accommodate this. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-locking: Instead of comparing key, compare key hashAmitay Isaacs2014-03-281-4/+6
| | | | | | | | | | | This replaces memory comparison of the key with integer comparison. In addition, this also avoids scheduling locks with the same hash. 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 28 05:28:58 CET 2014 on sn-devel-104
* ctdb-locking: Check for talloc_memdup errorAmitay Isaacs2014-03-281-0/+5
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-locking: Avoid memory leakAmitay Isaacs2014-03-281-0/+1
| | | | | | | | If lock_request could not be allocated, free lock_ctx since there can only be a single lock_request per lock_ctx. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Add NAT gateway eventscript unit tests for static routesMartin Schwenke2014-03-266-0/+207
| | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Wed Mar 26 06:24:01 CET 2014 on sn-devel-104
* ctdb-eventscripts: CTDB_NATGW_STATIC_ROUTES can specify gatewaysMartin Schwenke2014-03-262-8/+27
| | | | | | | Extend CTDB_NATGW_STATIC_ROUTES so that each network can have an optional gateway that overrides CTDB_NATGW_DEFAULT_GATEWAY. Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-eventscripts: New configuration variable CTDB_NATGW_STATIC_ROUTESMartin Schwenke2014-03-263-5/+64
| | | | | | | This can be used to create more specific NATGW routes than the usual NATGW default route. Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-eventscripts: Clarify that CTDB_NATGW_DEFAULT_GATEWAY is optionalMartin Schwenke2014-03-263-9/+14
| | | | | | | | | This has been implied since the command to add the route has had errors redirected to /dev/null. If infrastucture (e.g. ADS, DNS) is on the same network as CTDB_NATGW_PUBLIC_IP then no route is necessary. Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-eventscripts: Improve check in NATGW "startup" eventMartin Schwenke2014-03-261-2/+5
| | | | | | | | | | | | Although the dots in $CTDB_NATGW_PUBLIC_IP could probably only help match an invalid public IP address, this is only executed once so do as exact a check as possible. Use CTDB_BASE instead of hardcoding /etc/ctdb. Make the error message less redundant. Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-eventscripts: Reformat natgw_clear()Martin Schwenke2014-03-261-9/+11
| | | | Signed-off-by: Martin Schwenke <martin@meltin.net>