summaryrefslogtreecommitdiffstats
path: root/ctdb/server
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-daemon: Rename ctdb_mkdir_p_or_die to mkdir_p_or_dieAmitay Isaacs2014-06-121-3/+3
| | | | | | | This function does not require ctdb context. 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-122-2/+2
| | | | | 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-122-3/+3
| | | | | 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-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: Drop ctdb prefix from utility functions independent of ctdbAmitay Isaacs2014-06-121-1/+1
| | | | | 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-121-1/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* 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-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: 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-232-0/+54
| | | | | | | | | | | | 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-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-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>
* ctdb-daemon: Add control CTDB_CONTROL_DB_DETACHAmitay Isaacs2014-04-142-0/+88
| | | | | | | 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-073-16/+15
| | | | | | | | | | | | | 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
* 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-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/daemon: Optimise deletion of IPsMartin Schwenke2014-03-231-11/+11
| | | | | | | | | | | | | | | | Previous commits maintained the ordering between ctdb_remove_orphaned_ifaces() and ctdb_vnn_unassign_iface(). This meant that ctdb_remove_orphaned_ifaces() needed to steal the orphaned interfaces and they would be freed later. Unassign the interface first and things get simpler. ctdb_remove_orphaned_ifaces() is now self-contained. 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): Sun Mar 23 06:20:43 CET 2014 on sn-devel-104
* ctdb/daemon: Make delete IP wait until the IP is releasedMartin Schwenke2014-03-232-30/+92
| | | | | | | | | | | | reloadips really expects deleted IPs to be released before completing. Otherwise the recovery daemon starts failing the local IP check. The races that follow can cause a node to be banned. To make the error handling simple, do the actual deletion in release_ip_callback(). Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Do not disable monitoring when running eventscriptsMartin Schwenke2014-03-231-5/+0
| | | | | | | | | | | | This is racy and cbffbb7c2f406fc1d8ebad3c531cc2757232690e makes it unnecessary. The eventscript code still knows that monitor events are special compared to other events. However, the general concept of monitoring is no longer tangled up with running scripts. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Fix tickle updates to recently started nodesMartin Schwenke2014-03-231-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 0723fedcedd4a97870f7b1224945f1587363c9bf added a cheap implemention of ctdb_control_startup() that simply flags the recipient node as needing to send updates for each IP when the tickle update loop next fires. Commit 026996550d726836091ff5ebd1ebf925bf237bb0 ensures that a node only sends tickle updates once being flagged to do so. CTDB_CONTROL_STARTUP is broadcast to all nodes, so this is a good start. However, the tickle updates are only broadcast to connected nodes. A recently started node may not yet be considered to be connected because the keepalive monitoring loop may not yet have marked the node as connected. This means that the tickle update loop races with the keepalive monitoring loop. If the tickle update loop wins then updates will not be sent to the recently started node. The simplest improvement is to stop the tickle update from depending on whether a node is connected or not. So instead of broadcasting tickle updates to connected nodes, they are broadcast to all nodes. Since no reply is expected, this should work just fine. While looking at this code, ctdb_ctrl_set_tcp_tickles() is named like a client function. It isn't a client function. Also, 2 of the arguments are ignored. So rename this function to ctdb_send_set_tcp_tickles_for_ip() and remove the ignored arguments. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: fix delete list counts in delete_marshall_traverse_firstMichael Adam2014-03-061-0/+2
| | | | | | | | | | when bumping skipped, decrement left, so the sum is correct 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 Mar 6 03:32:33 CET 2014 on sn-devel-104
* ctdb-vacuum: fix possible cause for delelete_list processing counts left ↵Michael Adam2014-03-061-0/+16
| | | | | | | | | records > 0 We need to have left records == 0 at the end of the delete list processing. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: systematize counters into various structsMichael Adam2014-03-061-109/+123
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: remove unused counter vdata->totalMichael Adam2014-03-061-3/+0
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: make ctdb_process_delete_list() voidMichael Adam2014-03-061-19/+6
| | | | | | | The overall return code was not really used anyways. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: make ctdb_process_vacuum_fetch_lists() void.Michael Adam2014-03-061-7/+4
| | | | | | | This constantly returns 0 anyways. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: make ctdb_vacuum_traverse_db() void.Michael Adam2014-03-061-8/+4
| | | | | | | | Failure in traversal of the DB should not prevent further processing. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: don't stop in process_vacuum_fetch_lists when sending to one ↵Michael Adam2014-03-061-1/+0
| | | | | | | | | | | node fails. We should try to continue vacuuming as much as possible. Failure to send records to one lmaster doesn't mean the others will fail too. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: catch and log errors to traverse the delete list in ↵Michael Adam2014-03-061-6/+18
| | | | | | | ctdb_process_delete_list() Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: catch and log error of traverse in ctdb_process_delete_queue()Michael Adam2014-03-061-1/+8
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: use tdb_parse_record instead of tdb_fetch in ↵Michael Adam2014-03-061-26/+8
| | | | | | | | | delete_marshall_traverse_first() Spare malloc and free. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: simplify delete_marshall_traverse_first: use tdb_nullMichael Adam2014-03-061-5/+2
| | | | | | | | we know anyways the record to store is empty at this point. So skip pointer calculations. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: remove VacuumLimit criterion for triggering a repackMichael Adam2014-03-061-5/+1
| | | | | | | | | | With the new vacuuming, we consider it an error if there are records left for deletion after processing the various lists. All records that can be deleted should have been deleted by tdb_delete calls. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: treat value 0 of tunable VacuumLimit as turning off repackingMichael Adam2014-03-061-1/+1
| | | | | | | | I.e. no number of records found to delete will trigger the repacking. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: add consistency check for counts at end of process_delete_list()Michael Adam2014-03-061-0/+14
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: log error if records are left for deletion after ↵Michael Adam2014-03-061-0/+8
| | | | | | | ctdb_process_delete_list() Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: use tdb_parse_record instead of tdb_fetch in ↵Michael Adam2014-03-061-23/+7
| | | | | | | | | delete_record_traverse() Spare malloc and free. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: update comment for ctdb_process_delete_queueMichael Adam2014-03-061-2/+3
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: rename ctdb_vacuum_db_fast --> ctdb_process_delete_queueMichael Adam2014-03-061-3/+3
| | | | | | | This describes more precisely what this does. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: update comment for ctdb_vacuum_traverse_dbMichael Adam2014-03-061-1/+0
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: rename ctdb_vacuum_db_full --> ctdb_vacuum_traverse_dbMichael Adam2014-03-061-3/+3
| | | | | | | This describes more precisely what it actually is, nowadays. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: change full db traverse vacuuming to fill delete queueMichael Adam2014-03-061-30/+18
| | | | | | | | | | | | | | | | | | This lets the "fast vacuum" delete queue traverse do the actual work. On the positive side, we note that this lets the "full vacuuming" treat the records that have never been migrated with data correctly. These had previously been added to the delete list for complicated cross-node deletion instead of directly deleting them. On the other hand side, there might be a slight overhead since the records are read again in the delete queu traverse, but this is OK because this change is in preparation of untangling the db traverse altogether from the vacuum run, making it independent. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: run the fast vacuum after the db traverseMichael Adam2014-03-061-2/+2
| | | | | | | | | | This in preparation of modifying the db traverse to fill the delete_queue that is processed by the fast vacuum run, instead of filling the same lists as the fast vacuum run for further processing. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: rename private->private_data in repack_traverseMichael Adam2014-03-061-2/+3
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: rename private->private_data in vacuum_traverseMichael Adam2014-03-061-2/+4
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>