summaryrefslogtreecommitdiffstats
path: root/ctdb
Commit message (Collapse)AuthorAgeFilesLines
...
* ctdb-tools-ctdb: Remove redundant filtering of trailing empty linesMartin Schwenke2014-03-231-3/+0
| | | | | | | There is a check for empty lines in the loop just below. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Use DLIST_ADD_END() to avoid reversing the listMartin Schwenke2014-03-231-14/+3
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Factor out function read_pnn_node_file()Martin Schwenke2014-03-231-58/+36
| | | | | | | | Factor it from read_nodes_file(). Use it there and in read_natgw_nodes_file(). Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add "ctdb listnodes" and "ctdb xpnn" stub testsMartin Schwenke2014-03-238-1/+158
| | | | | | | | | | | | | | | Tests for xpnn need to implement a stub for ctdb_sys_have_ip(). The cheapest way of doing this is to read a fake nodemap using the existing code and check if the IP of the "current" node is the one being asked about. However, the fake state initialisation isn't currently available to without_daemon commands because it is meant to represent daemon state. However, it can be made available by moving the relevant code into a new stub for tevent_context_init(). The stub still needs to initialise a tevent context - this can be done by calling a lower level function. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Read NAT gateway nodes from a separate functionMartin Schwenke2014-03-231-38/+53
| | | | | | | Now it gets easier to refactor. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Add and use function filter_nodemap_by_natgw_nodes()Martin Schwenke2014-03-231-29/+43
| | | | | | | | | | | | Add another filter function, like the ones for capabilities and flags to, for filtering by NAT gateway nodes. This makes the main natgw_list function more readable. Note that this drops the early filtering of disconnected nodes, so they will now be listed in a NAT gateway group. This makes sense. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Update LVS commands to use filter_nodemap_by_flags()Martin Schwenke2014-03-231-67/+41
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Update LVS commands to use filter_nodemap_by_capabilities()Martin Schwenke2014-03-231-42/+22
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Fixes for "lvs" and "lvsmaster" commandsMartin Schwenke2014-03-231-3/+4
| | | | | | | The index of the nodes array in nodemap isn't the PNN. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Generalise find_natgw() -> filter_nodemap_by_flags()Martin Schwenke2014-03-231-15/+28
| | | | | | | | | | | | Instead of just finding the first node that doesn't have any flags in flag_mask set, change it into a function that filters a nodemap to exclude nodes with the given flags. This makes the NATGW code simpler but also provides a function that can be used in other code. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Update natgwlist to filter nodes by NATGW capabilityMartin Schwenke2014-03-231-14/+55
| | | | | | | | Check capabilities once to build a filtered node list instead of repeatedly checking capabilities Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: New natgwlist tests where nodes capability not setMartin Schwenke2014-03-232-0/+74
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Update ctdb stub LVS tests and add some new onesMartin Schwenke2014-03-2310-5/+194
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Support fake capabilities in CTDB tool stubMartin Schwenke2014-03-232-4/+77
| | | | | | | ... and add a test to make sure it works. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Remove old, unused copy of a CTDB tool unit testMartin Schwenke2014-03-231-34/+0
| | | | | | | | This looks to have got left behind a long time ago when things got moved around... Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools-ctdb: Don't close stderr when running without_daemon commandsMartin Schwenke2014-03-231-1/+0
| | | | | | | | | | | | | It looks like the original without_daemon code still tried to establish a client connection to the daemon. Closing stderr looks to be a cheap way of hiding the errors when this failed. However, later cleanups avoid the client connection altogether, so do not close stderr. Now debug output from without_daemon commands actually appears. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb/pmda: Fix metric identifiersDavid Disseldorp2014-03-221-123/+141
| | | | | | | | | | | | | | | The commit "pmda: Use upstream assigned PCP domain id" updated the Performance Metrics Namespace (pmns) file, without changing the corresponding metric identifiers used by the agent. This change fixes the agent metric identifier values to match the pmns definitions. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Mar 22 00:07:31 CET 2014 on sn-devel-104
* 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>
* ctdb-vacuum: extract check for full vacuum run out of ctdb_vacuum_db_full()Michael Adam2014-03-061-9/+6
| | | | | | | This is more consistent. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: add consistency check for counts to ctdb_vacuum_db_fast()Michael Adam2014-03-061-0/+15
| | | | | 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-16/+19
| | | | | | | | | delete_queue_traverse() this spares malloc and free Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: simplify delete_record_traverse() - free treats NULLMichael Adam2014-03-061-3/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: simplify delete_queue_traverse() - free treats NULL pointers.Michael Adam2014-03-061-3/+2
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: reduce indentation in delete_queue_traverseMichael Adam2014-03-061-6/+7
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: treat value 0 of tunable RepackLimit as turned off.Michael Adam2014-03-061-7/+9
| | | | | | | | I.e. when RepackLimit is set to 0, no size of the freelist should trigger a repack in vacuuming. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-vacuum: fix treatment of remaining records and statistics in ↵Michael Adam2014-03-061-24/+16
| | | | | | | delete_record_traverse() Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>