summaryrefslogtreecommitdiffstats
path: root/ctdb
Commit message (Collapse)AuthorAgeFilesLines
* ctdb:vacuum: use plain tdb_repack() instead of ctdb_repack_tdb()Michael Adam2014-06-171-1/+1
| | | | | | | | | Since we usually have 0 records left for repack-deletion, repacking is essentially used for the purpose of defragmenting the freelist, we can use the vanilla tdb_repack function. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb:vacuum: remove a comment in ctdb_vacuum_and_repack_db()Michael Adam2014-06-171-3/+0
| | | | | | | | The repack operation now mainly defragments the freelist and does not usually delete any records any more. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb:vacuum: adapt debug message for repacking.Michael Adam2014-06-171-2/+2
| | | | | | | | | Now we usually have records to delete == 0 after the preceding vacuum run. Anyways, deletion is not a major aspect any more of the repack run and will vanish soon. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb:build: fix building with external libtdbMichael Adam2014-06-161-7/+7
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
* ctdb-daemon: Reset scheduler policy for helper processesAmitay Isaacs2014-06-122-0/+4
| | | | | | | | | | | | | Do not run helper processes with real-time priority. This regression was caused when locking and eventscript code switched to use vfork() and helper instead of ctdb_fork(). 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 Jun 12 08:10:36 CEST 2014 on sn-devel-104
* ctdb-daemon: Do not complain if node is inactive and db is not attachedAmitay Isaacs2014-06-121-1/+4
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-build: Remove duplicate library dependencyAmitay Isaacs2014-06-121-1/+1
| | | | | | | LIB_FLAGS includes TDB_LIBS. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Remove duplicate code from helper binariesAmitay Isaacs2014-06-123-16/+9
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-logging: Move controls handling functions from common to serverAmitay Isaacs2014-06-122-42/+40
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-logging: Split ringbuffer handling code from ctdb_collect_logAmitay Isaacs2014-06-122-7/+23
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Move mkdir_p_or_die to system utilitiesAmitay Isaacs2014-06-122-14/+14
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Rename ctdb_mkdir_p_or_die to mkdir_p_or_dieAmitay Isaacs2014-06-123-5/+5
| | | | | | | This function does not require ctdb context. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Move lockdown_memory to system utilitiesAmitay Isaacs2014-06-122-27/+28
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Rename ctdb_lockdown_memory to lockdown_memoryAmitay Isaacs2014-06-124-4/+4
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Instead of passing ctdb context, pass valgrinding booleanAmitay Isaacs2014-06-124-6/+6
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Keep debug level related functions with logging codeAmitay Isaacs2014-06-122-40/+40
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Rename block_signal to ignore_signalAmitay Isaacs2014-06-121-2/+2
| | | | | | | This function does not block signals, but ignores them. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Remove unused functionsAmitay Isaacs2014-06-122-18/+0
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: No need to block SIGPIPE at startupAmitay Isaacs2014-06-121-1/+0
| | | | | | | Once CTDB is daemonized, it starts ignoring SIGPIPE anyway. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Separate more system utilities that are independent of ctdbAmitay Isaacs2014-06-122-251/+252
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Separate system utilties that are ctdb independentAmitay Isaacs2014-06-125-50/+74
| | | | | | | | Routines in system_common and system_<os> are supposed to be ctdb functions with OS specific implementations. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: No dynamic memory allocation in mkdir_p()Martin Schwenke2014-06-121-10/+27
| | | | | | | | | Allocate an array of size PATH_MAX on the stack instead. To stop unnecessary recursion, try to create the desired directory before creating ancestors and only create ancestors on ENOENT. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Do not dynamically allocate memory when not necessaryMartin Schwenke2014-06-121-19/+17
| | | | | | | | Copy these values onto the stack instead. INET6_ADDRSTRLEN is 46, so 64 is plenty for an IP address and a port number. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Drop ctdb prefix from utility functions independent of ctdbAmitay Isaacs2014-06-124-7/+7
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Changing scheduler policy does not require ctdb contextAmitay Isaacs2014-06-124-6/+6
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Do not abort if restoring scheduling policy failsAmitay Isaacs2014-06-121-3/+3
| | | | | | | | This code is only executed in child processes, so aborting does not really achieve much. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: No need to save previous scheduler priorityAmitay Isaacs2014-06-122-27/+8
| | | | | | | | When calling sched_setscheduler() with SCHED_OTHER, the only valid priority is 0. Nice value is "restored" anyway. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* 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>