summaryrefslogtreecommitdiffstats
path: root/ctdb/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* tools/ctdb: Remove setdbseqnum commandAmitay Isaacs2013-10-041-86/+0
| | | | | | | | | | This command was added to test persistent database recovery with sequence numbers. With the new persistent transaction code, sequence numbers get updated automatically, so there is no need for this command. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 14bfd22fad1a5fd27eede1be7fccbaed9466e13e)
* tools/ctdb: Stop return value from being clobbered in control_lvsmaster()Martin Schwenke2013-10-041-2/+2
| | | | | | | | | | ret is initialised too early and is clobbered by the call to ctdb_ctrl_getcapabilities(). Initialising it later means that the function returns -1 when no LVS master is found. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 3296559c43e70f755fcf2c06677891e0319c8142)
* tools/ctdb: Pass memory context for returning nodes in parse_nodestringAmitay Isaacs2013-10-041-7/+8
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 1585a8e275b0143e5e46311b3d5e9785119f735f)
* tools/ctdb: Do not use libctdb for commandline toolAmitay Isaacs2013-10-041-107/+200
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit cd66282c635cf53386d8970b89c895076ea21cbd)
* tools/ctdb: When printing TDB data as a string, use correct length of the stringAmitay Isaacs2013-10-041-1/+1
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit d94a10f93a0925b17458d009e604966666b3d880)
* tools/ctdb: Remove un-implemented ctdb vacuum commandAmitay Isaacs2013-10-042-10/+0
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 8b238852884004a56f76a1762199c338864d1249)
* tool/ltdbtool: -h option does not require an argumentMartin Schwenke2013-09-251-1/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9e18f3c173863919587e25d704f66372624ed8ed)
* tools/ctdb: Fix help messages for ctdb commandsMartin Schwenke2013-09-251-4/+4
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 49c87699fad151933a0aefebfee968fc850e6383)
* tools/ctdb: Ban time of 0 is invalidMartin Schwenke2013-09-251-0/+5
| | | | | | | | | Apparently it used to mean a permanent ban but it is unclear if this was ever supported. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c8a6e5ce579e2fe320c40268e7e9ddfe68b8cd30)
* tools/ctdb: Use the standard long timeout when disabling takeover runsMartin Schwenke2013-09-191-2/+4
| | | | | | | | | This means that takeover runs will be disabled for about as long as the reloadips control can take to complete. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 6d44657a5e5b0df22bab2d487a503dd1c5ba79b4)
* tools/ctdb: Fix arguments/semantics of rebalance nodeMartin Schwenke2013-09-191-6/+20
| | | | | | | | | | | | | | | There's no reason why specifying a node should be compulsory. This is a cluster-wide operation because it is implemented by the recovery master so multiple nodes should not be specified using -n. However, the command should be able to specify multiple nodes so let it have its own nodestring argument. This change should be backward compatible with the old requirement of specifying a single node via -n. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0846c00597adb66bba8c9dbf63443d0c2f91a7d1)
* tools/ctdb: Make rebalancenode more robustMartin Schwenke2013-09-191-8/+4
| | | | | | | | | | Use a broadcast instead of trying to win the race of determining the recovery master and then sending the message before the recovery master changes. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit ac946ee4ad01b1e5cd1006930b9f8a190a0a58ba)
* tools/ctdb: Reimplement reloadipsMartin Schwenke2013-09-191-70/+40
| | | | | | | | | | | | | | | This implementation disables takeover runs on all nodes before trying to reload IPs. It also takes "all" or the list of PNNs as an argument to the command instead of to -n. -n can still be specified with a single node indicating that node should be considered the current node - that might be confusing so could be removed. This implementation does not use CTDB_SRVID_RELOAD_ALL_IPS, so it can be removed. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d66a072d9b120c78c47e726e9f29a3c1cfdd87ce)
* tools/ctdb: Add a wait_for_all option to srvid_broadcast()Martin Schwenke2013-09-191-13/+82
| | | | | | | | | | | | This will be useful for other SRVIDs. The error checking in the handler depends on the SRVID responding with a uint32_t where <0 indicates an error and >=0 is a PNN that succeeded. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 52050e1c75b21961dafe2bc410268b44240ab24e)
* tools/ctdb: Factor out SRVID broadcast code from ipreallocate()Martin Schwenke2013-09-191-26/+40
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a566fb5e70282c4e9f76654b1be4dc80829dced0)
* tools/ctdb: Change ipreallocate() to use a local done flagMartin Schwenke2013-09-191-6/+10
| | | | | | | | | Instead of the current global variable. This is in anticipation of abstracting the code. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c58ee0eddf7ae3283e3ca8bd25575e6e677e1b17)
* recoverd: Make the SRVID request structure genericMartin Schwenke2013-09-191-2/+3
| | | | | | | | No need for a separate one for each SRVID. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d9c22b04d5aa7938a3965bd3144568664eb772ce)
* tools/ctdb: list_of_active_nodes_except_pnn() -> list_of_nodes()Martin Schwenke2013-09-111-1/+1
| | | | | | | | | list_of_active_nodes_except_pnn() is only used here and can be removed if we remove this call. Less is more... Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d4e206fb818048b7fab4797c877b854bdbb1ab70)
* tools/ctdb: Fix a memory leak in parse_nodestring()Martin Schwenke2013-09-111-2/+3
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 8753a094b97340deb26dd44f6ea345ca0a642a95)
* tools/ctdb_diagnostics: Add output of "ctdb getdbmap"Martin Schwenke2013-08-221-0/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit f0d69a9079b7aecc68f1d2d8510702046b618b19)
* tools/ctdb_diagnostics: Safer temporary file creationMartin Schwenke2013-08-221-3/+10
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 406e1cb1fdd17ddd239774d0228e3657b73ae68f)
* tools/ctdb: Make most non-auto-all commands abort if run with -n allMartin Schwenke2013-08-221-6/+42
| | | | | | | | Or if run with -n A,B,... Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b1d8732b5da18ae80aea1df0e66b0b5cdcd919bc)
* tools/ctdb: Remove more non-essential fetching of PNN from daemonMartin Schwenke2013-08-221-25/+21
| | | | | | | | | | | The useful cases are either CTDB_CURRENT_NODE, in which case ctdb_get_pnn() does the job, or a PNN, which is... ummm... a PNN! :-) This works because parse_nodestring() validates PNNs. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 7b3f7eea2465efb099a2faf3e42174bc97b13a16)
* tools/ctdb: Improve auto-all settings for some commandsMartin Schwenke2013-08-221-8/+8
| | | | | | | | | | | | | | * ipreallocate is cluster-wide so should not be auto-all * enablescript, disablescript, getreclock, setreclock, natgwlist can all be auto-all without issues * xpnn, ipiface a local-only so don't work with -n, so might as well not be auto-all Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 123a4677528cb46bee1c6dad8a5162eba9880bc1)
* tools/ctdb: Fix message in showban when node is bannedMartin Schwenke2013-08-211-1/+2
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 5cdad2b8ebd71a5e458c301d00eac00a211feeb3)
* tools/ctdb: Reimplement ban/unban using update_flags_wait_and_ipreallocate()Martin Schwenke2013-08-211-61/+18
| | | | | | | | | This has the side effect of making these commands more resilient to control timeouts. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0fe79662e20e347d9e1cb12a42cd356e33572402)
* tools/ctdb: Factor out common pattern used in disable/enable/stop/continueMartin Schwenke2013-08-211-119/+76
| | | | | | | | | Now we will only have one set of bugs. :-) Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 444521c852749558f39dc6131acce9e47eefd489)
* tools/ctdb: Factor, simplify and improve robustness of ipreallocate codeMartin Schwenke2013-08-211-45/+32
| | | | | | | | | | | | | | | | | | | Having other functions call control_ipreallocate() suggests that the it might look at the argv/argv arguments that are passed. This is not the case. Change the callers so they call the new ipreallocate() function instead. Broadcast CTDB_SRVID_TAKEOVER_RUN to all connected nodes. Inactive nodes will ignore it. This is safe since we only want 1 reply. If we didn't get a response, we don't actually care if there's no active recovery master - just fire, wait, retry, ... Ignore some failures on the basis that they might be transient, so it is probably worth retrying. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 4bf0b1c9d21986eecb7682f935bd6154c65533cc)
* tools/ctdb: Use ctdb_get_pnn() to get PNN of the current nodeMartin Schwenke2013-08-211-29/+5
| | | | | | | | This has already been stored at connect time and can't fail. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d8eb2e7fdd7645719370dad4f2faa5c3fffa8249)
* tools/ctdb: Increase default control timeout to 10 secondsMartin Schwenke2013-08-141-1/+1
| | | | | | | | | The current 3 second timeout is arbitrary and users trip over it sometimes. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b49c4f39666d5b1596213bf41bcdc47ed3c327ae)
* tools/ctdb: Only print the hot records with non-zero hopcountAmitay Isaacs2013-07-301-0/+9
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 049d9beb3783482490e6273a434ccbad23f85f0a)
* tools/ctdb: Allow killtcp to read connections from standard inputMartin Schwenke2013-07-291-1/+111
| | | | | | | | | | | This will allows eventscripts to send information about multiple tcp connections to a single "ctdb killtcp" command, saving the overhead of setting up a client connection per tcp connection. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit af5aa369c266430fe912df0c26116b68bac3572e)
* Print deleted nodes as wellSumit Bose2013-07-111-1/+12
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 0930a3b806977555509c3228726e2250aef1f971)
* tools/ctdb: Fix the format of DB statistics outputAmitay Isaacs2013-07-101-9/+14
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 594c421f90ce132c75fbd985872114e4967f92b5)
* tools/ctdb: Add "force" option to "recover" commandMartin Schwenke2013-06-281-2/+9
| | | | | | | | | | At the moment there is no easy way to force a recovery when attempting to reproduce certain classes of bugs. This option is added without documentation because it is dangerous until the bugs are fixed! :-) Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 4f87925a287f612a6ab3b5da1a387a31c7bea28f)
* tools/ctdb: Do not exit prematurely on control timeout if retrying in a loopAmitay Isaacs2013-06-201-5/+4
| | | | | | | | | | | | This avoids premature exits from "ctdb stop" and "ctdb continue" due to intermittent control (e.g. getpnn, getnodemap) timeouts. This needs a proper fix to distinguish between timeout and failure conditions and take appropriate action. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit c48583fd238496a81ddc46a21892f0b49559036a)
* ctdbd: Update the get_tunable code to return -EINVAL for unknown tunableMartin Schwenke2013-05-241-1/+1
| | | | | | | | | Otherwise callers can't tell the difference between some other failure (e.g. memory allocation failure) and an unknown tunable. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 03fd90d41f9cd9b8c42dc6b8b8d46ae19101a544)
* ctdbd: Add new runstate CTDB_RUNSTATE_FIRST_RECOVERYMartin Schwenke2013-05-241-1/+1
| | | | | | | | | | | | | | This adds more serialisation to the startup, ensuring that the "startup" event runs after everything to do with the first recovery (including the "recovered" event). Given that it now takes longer to get to the "startup" state, the initscript needs to wait until ctdbd gets to "first_recovery". Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit ed6814ff0a59ddbb1c1b3128b505380f60d7aeb7)
* tools/ctdb: "ctdb runstate" now accepts optional expected run state argumentsMartin Schwenke2013-05-241-1/+24
| | | | | | | | | | | | | | | | | | | | | If one or more run states are specified then "ctdb runstate" succeeds only if ctdbd is in one of those run states. At the moment, if the "setup" event fails then the initscript succeeds but ctdbd exits almost immediately. This behaviour isn't very friendly. The initscript now waits until ctdbd is in "startup" or "running" run state via the use of "ctdb runstate startup running", meaning that ctdbd has successfully passed the "setup" event. The "setup" event code in 00.ctdb now waits until ctdbd is in the "setup" run state before proceeding via the use of "ctdb runstate setup". Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 4a2effcc455be67ff4a779a59ca81ba584312cd6)
* tools/ctdb: New command runstate to print current runstateMartin Schwenke2013-05-241-0/+21
| | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit bf20c3ab090f75f59097b36186347cedb1c445d4)
* tools/ctdb: Remove duplicate command definition for "sync"Martin Schwenke2013-05-241-2/+1
| | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 9e7b7cd04adc5e66e2ffa4edf463a682aaea379b)
* tools/ctdb: Fix racy ipreallocate codeAmitay Isaacs2013-05-231-63/+22
| | | | | | | | | | | | | | | | | This code tried to find the recovery master and send an ipreallocate request to that node. When a node is stopped, this code asked the stopped node for recovery master. Stopped node does not have up-to-date information on the current recovery master. So ipreallocate requests were sent to the wrong node and ignored by that node which is not the recovery master. Send ipreallocate request to all active nodes. That way we guarantee that the current recovery master will see it and respond to it. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Pair-Programmed-With: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0577ce3c68e4febf49a1ef5093e918db9d5ec636)
* build: Rename version.h to ctdb_version.hAmitay Isaacs2013-05-231-1/+1
| | | | | | | | This avoids clash with version.h from Samba tree. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit d18fcfff674e876abde8d51afec92d9c4a090d2f)
* tools/ltdbtool: Fix handling of -e optionAmitay Isaacs2013-04-081-3/+6
| | | | | | | | Also, include description of -e option in usage. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 35264e42ade4676468cf7713fa339c784e932953)
* fix a typoVolker Lendecke2013-03-121-1/+1
| | | | | | Reviewed-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit 98abd344342a011a8599411deae79f94abc09541)
* tools/ctdb: delip no longer fails if IP can not be movedMartin Schwenke2013-02-271-76/+83
| | | | | | | | | | | | Moving the IP is an optimisation so should not cause failure. Refactor and simplify the retry-move-IP into new function try_moveip(). Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 5402f85dde045576cbaf64e01c68e28ed52204e8)
* tools/ctdb: Fix a compiler warningMartin Schwenke2013-02-041-1/+1
| | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit d1ec06d30148e6fd344625a2fbf1c22391bd908a)
* tools/ctdb: Add setdbseqnum command to set __db_sequence_number__Amitay Isaacs2013-01-091-0/+86
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit efaac27a9ed52ed0f436c7e194013fd06e8b02b3)
* tools/ctdb: Re-factor code to check if db exists given name or idAmitay Isaacs2013-01-091-212/+110
| | | | | | | | | | | | Most of the commands related to database operations can now use the common code (db_exists()) to refer to database with either name or id. In addition to return db_id for db_name, the function returns all the flags set for the database. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit ca6e7eccc90f2869c220231666bf284798342bce)
* tools/ctdb: Add pdelete command to delete a record from persistent databaseAmitay Isaacs2013-01-091-0/+67
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit d23adec89b69e7c6f96c8e1417ef4ca4c9edc57e)