summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * locking: Use database iterator for locking databasesAmitay Isaacs2013-05-241-38/+2
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit d2634d72d9ca0ceeb72cbb1adc95017a234480fd)
| * locking: Add handler function for locking a databaseAmitay Isaacs2013-05-241-0/+20
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 2a1c933ef7c78ee071e2a640ea10941f1c12e32a)
| * locking: Refactor code to iterate over databases based on priorityAmitay Isaacs2013-05-241-0/+42
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit a3275854812aca86032704134fdf6a129069c86a)
| * locking: Add newline to debug logsAmitay Isaacs2013-05-241-2/+2
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit d98a861716d5f8c1f4387d21666396d3164551b3)
| * 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)
| * ctdbd: Print version string in the daemon startupAmitay Isaacs2013-05-231-1/+3
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 9d4524d13cbba21bfaf61bd35667984359b379b3)
| * build: Rename version.h to ctdb_version.hAmitay Isaacs2013-05-235-5/+5
| | | | | | | | | | | | | | | | This avoids clash with version.h from Samba tree. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit d18fcfff674e876abde8d51afec92d9c4a090d2f)
| * logging: Fix a bug in ringbufferAmitay Isaacs2013-05-231-36/+26
| | | | | | | | | | | | | | | | | | | | | | When ringbuffer is full, it does not return any entries. Simplify ringbuffer logic by keeping track of number of log entries rather than last entry. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Pair-Programmed-With: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 939d12b96a0cbebbe6269fa2b14f584058dd6174)
| * recoverd: takeover_run_core() should not use modified node flagsMartin Schwenke2013-05-232-119/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modifying the node flags with IP-allocation-only flags is not necessary. It causes breakage if the flags are not cleared after use. ctdb_takeover_run() no longer needs the general node flags - it only needs the IP flags. Instead of modifying the node flags in nodemap, construct a custom IP flags list and have takeover_run_core() use that instead of node flags. As well as being safer, this makes the IP allocation code more self contained and a little bit clearer. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 14bd0b6961ef1294e9cba74ce875386b7dfbf446)
| * ctdbd: Update confusing log messageMartin Schwenke2013-05-231-1/+1
| | | | | | | | | | | | | | | | | | Inactive can also mean stopped. To add information, just print the flags instead. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a8605f7e06076e7edf84e0cc160fd3d9ab5c4b64)
| * Packaging: maketarball.sh should be a bash script due to pushd useMartin Schwenke2013-05-231-1/+1
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 3105f9e291d0792199ac9e689f6d0e0a47ee4b0d)
| * scripts: Rework notify.sh to use notify.d/ directoryMartin Schwenke2013-05-234-44/+70
| | | | | | | | | | | | | | | | This makes it easier to add notification handlers. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d29e9a420b133088bf23a847c8d1dbce56c25eb0)
| * ctdbd: Log a message when recovery master changesMartin Schwenke2013-05-231-1/+14
| | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 1f96ea08f9a39dfe537c9b957ac512c84dc76f91)
| * ctdbd: Log add and delete of IPsMartin Schwenke2013-05-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | At the moment, when someone deletes all the IPs on a node, all we see are the release IP messages and we have to guess why. Some would argue that add/release are more significant than take/release so they should be logged. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 3c3df1d6afec7e3e721f9bcd4e8b8e008fd6e50b)
| * ctdbd: Removed bogus comment in ctdb_find_iface()Martin Schwenke2013-05-221-1/+0
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 4a8d90d0812a3242f58a2a0e2aa0f528f60f7013)
| * eventscripts: Fix regression in _loadconfig()Martin Schwenke2013-05-221-1/+8
| | | | | | | | | | | | | | | | | | | | | | fff88940f71058e4eefd65f50a6701389c005c17 introduced a regression. Without $service_name set by default, the CTDB configuration is no longer loaded when loadconfig() is called without any arguments. That's bad. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit f1619a36c1beba11533052dc5728fa3adaa08870)
| * initscript: If CTDB doesn't become ready, print a message before killingMartin Schwenke2013-05-221-0/+1
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit e6b6b793f61556c21e8daf34abf89ee7b388ecfb)
| * build: Create sudoers.d dir during make installChristian Ambach2013-05-201-0/+1
| | | | | | | | | | | | | | | | otherwise make install into non-standard prefix will fail Signed-off-by: Christian Ambach <ambi@samba.org> (This used to be ctdb commit 0c0752515b66661ffae24be5f138bd2fab4dec5c)
| * eventscripts: Do not use bashism for string comparisonAmitay Isaacs2013-05-201-1/+1
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit b0cae7d5a00ef3764bae187affc8e9a252f4b329)
| * recoverd: Move IP flags into ctdb_takeover.cMartin Schwenke2013-05-092-5/+6
| | | | | | | | | | | | | | | | These should never be seen outside the IP allocation code. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit e143abd16ccde2e0edfe103673d31a5fb06b6aef)
| * recoverd: Clear IP flags after IP allocation algorithm has runMartin Schwenke2013-05-091-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | If these flags are left set they will confuse other recovery daemon code. Factor the clearing code into new function clear_ipflags(). Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 45c776958017ea7001f061842c9e0f60e4a25f23)
| * recoverd: Remove unused mask argument and initial mask calculationMartin Schwenke2013-05-072-28/+6
| | | | | | | | | | | | | | | | This has been replaced by set_ipflags() and associated functionality. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d0a3822573db296e73cc897835f783c8abc084b3)
| * recoverd: When calculating rebalance candidates don't consider flagsMartin Schwenke2013-05-071-21/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is really a check to see if a node is already hosting IPs. If so, we assume it was previously healthy so it isn't considered as a rebalance candidate. There's no need to limit this to healthy node, since this is checked elsewhere. Due to this the variable newly_healthy is renamed everywhere to rebalance_candidates. The mask argument is now completely unused. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 65e0ea6c2c0629e19349ba4b9affa221fde2b070)
| * recoverd: Remove unused mask argument from IP allocation functionsMartin Schwenke2013-05-072-29/+19
| | | | | | | | | | | | | | | | | | This is a no-op and is in a separate commit to make the previous commit less cumbersome. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 107e656bbe24f9d21fbaf886a3e9417da4effe5a)
| * tests/takeover: Add takeover tests, mostly for NoIPHostOnAllDisabledMartin Schwenke2013-05-074-0/+178
| | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 7cf63722873a6a7baafd77aa3d8a1989b221dee9)
| * recoverd: Fix tunable NoIPTakeoverOnDisabled, rename to NoIPHostOnAllDisabledMartin Schwenke2013-05-079-89/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This really needs to be per-node. The rename is because nodes with this tunable switched on should drop IPs if they become unhealthy (or disabled in some other way). * Add new flag NODE_FLAGS_NOIPHOST, only used in recovery daemon. * Enhance set_ipflags_internal() and set_ipflags() to setup NODE_FLAGS_NOIPHOST depending on setting of NoIPHostOnAllDisabled and/or whether nodes are disabled/inactive. * Replace can_node_servce_ip() with functions can_node_host_ip() and can_node_takeover_ip(). These functions are the only ones that need to look at NODE_FLAGS_NOIPTAKEOVER and NODE_FLAGS_NOIPHOST. They can make the decision without looking at any other flags due to previous setup. * Remove explicit flag checking in IP allocation functions (including unassign_unsuitable_ips()) and just call can_node_host_ip() and can_node_takeover_ip() as appropriate. * Update test code to handle CTDB_SET_NoIPHostOnAllDisabled. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 1308a51f73f2e29ba4dbebb6111d9309a89732cc)
| * recoverd: Factor out new function all_nodes_are_disabled()Martin Schwenke2013-05-071-6/+12
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 12aef10e9889760d98f58c8d916f19d069fa381a)
| * tests/takeover: Allow per-node tunable settingsMartin Schwenke2013-05-073-11/+53
| | | | | | | | | | | | | | | | | | Implemented for CTDB_SET_NoIPTakeover. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit a1addd89fd9c0390912604097acd028cc24d3483)
| * recoverd: Refactor code to get NoIPTakeover tunable from all nodesMartin Schwenke2013-05-071-28/+101
| | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 1fb5352d2b6918fcc6f630db49275d25a3eebe8d)
| * tests: Unit test diff output should use filtered outputMartin Schwenke2013-05-071-1/+1
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9721aae001b3023e9c8b4af2b143c0db3442d623)
| * recoverd: Add debug message when dropping IPs in IP allocationMartin Schwenke2013-05-076-4/+25
| | | | | | | | | | | | | | | | Update tests accordingly. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 91405282ba4abad4ad8e8c5f7ee4c83c75f38280)
| * eventscripts: NFS RPC checks no longer support "knfsd"Martin Schwenke2013-05-071-1/+1
| | | | | | | | | | | | | | | | No longer used, support removed from test infrastructure. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0eb351ff4c7ee096de7c5e0a59561067091fa32e)
| * eventscripts: 60.nfs uses nfs_check_rpc_services() to check NFS RPC servicesMartin Schwenke2013-05-0714-118/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * New directory nfs-rpc-checks.d/ replaces hardcoded rules in 60.nfs * Installation and packaging additions to handle nfs-rpc-checks.d/ * Unit test updates, including deleting 1 test that sanity checked test infrastructure * Test infrastructure changes to use nfs-rpc-checks.d/ Note that this removes support for $CTDB_NFS_SKIP_KNFSD_ALIVE_CHECK in 60.nfs. To get the equivalent behaviour, edit 20.nfsd.check and remove/comment all lines. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 7e792d6768d9ca420ce3713cb122e63afd594b15)
| * eventscripts: NFS RPC checks allows "nfsd" in addition to "knfsd"Martin Schwenke2013-05-061-1/+1
| | | | | | | | | | | | | | | | Want nfs_check_rpc_services() to support filenames without the 'k'. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d9775fcbd6e30eef8382bea68e2f9bad2309f2c1)
| * eventscripts: New function nfs_check_rpc_services()Martin Schwenke2013-05-061-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is intended to replace nfs_check_rpc_service(), which builds configuration into eventscripts. nfs_check_rpc_services() uses a directory of configuration checks that can be edited by an administrator. The files have one limit check and a set of actions per line. The program name is extracted from the file name. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9bc8fbee6550ed2814fb35c70d57fab21ef1b8fd)
| * eventscripts: nfs_check_rpc_action() should be _nfs_check_rpc_action()Martin Schwenke2013-05-061-2/+2
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 5a717fd495ba5a2bfd481d69f38b68fa4576716f)
| * eventscripts: Factor out common code from nfs_check_rpc_service()Martin Schwenke2013-05-061-6/+17
| | | | | | | | | | | | | | | | This creates new function _nfs_check_rpc_common(). Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit cc3bb42e48bbdabd19187c231846b98589b4f4f3)
| * eventscripts: Remove ganesha support from nfs_check_rpc_service()Martin Schwenke2013-05-061-6/+0
| | | | | | | | | | | | | | | | | | This is unused so doesn't need to be maintained. An attempt to use it now will explicitly fail rather than implicitly fail via bitrot. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 887733dd7be53158bfe07b30ef31b611d0f8122f)
| * Revert "Eventscript functions: add optional version to nfs_check_rpc_service()"Martin Schwenke2013-05-061-10/+4
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 92f74fd589467b46c758e116e97417edfe8773d7. This change is unused and is just complicating the function. Conflicts: config/functions (This used to be ctdb commit 77302dbfd85754e02559eccb2dd6c090db0b6b9f)
| * eventscripts: Move rpc.statd existence check into nfs_check_rpc_service ()Martin Schwenke2013-05-062-10/+10
| | | | | | | | | | | | | | | | | | The code in 60.nfs is going to be genericised, so make all the checks look the same. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 15b0f78cbf8d6ba481b7eba9e4fe3f4270214c72)
| * eventscripts: Factor NFS RPC check action code into nfs_check_rpc_action()Martin Schwenke2013-05-061-46/+58
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 4b4e7d8f0e8dcbab987e374d06ffaa21c06da0d3)
| * eventscripts: Remove unused function ctdb_check_counter_limit()Martin Schwenke2013-05-061-15/+0
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a8ef00608e48a551a334aded206146807aeb4c5a)
| * eventscripts: Use ctdb_check_counter() instead of ctdb_check_counter_limit()Martin Schwenke2013-05-062-6/+7
| | | | | | | | | | | | | | | | ctdb_check_counter_limit() can soon be removed... Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit bb2cdff77e8ec79e7d319159b9c9848ecfaaa0f1)
| * eventscripts: Might as well try to stat the reclock file firstMartin Schwenke2013-05-061-9/+9
| | | | | | | | | | | | | | | | | | It is in the background but it still might cause the counter to be reset before it is checked. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit ef2cf75e95ff382c65524a4d77eb00ab8411d2fc)
| * eventscripts: Make the early exit in 01.reclock earlierMartin Schwenke2013-05-061-6/+3
| | | | | | | | | | | | | | | | That way we don't even check the counter... Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 136abd4604dc68f7c696704bac708bae53cf1940)
| * eventscripts: Minor cleanups for killtcp/tickle functionsMartin Schwenke2013-05-061-16/+17
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 25ef4f655f1efc833deb5e244f9fff461e92f439)
| * eventscripts: Tweak the timeout check in kill_tcp_connections()Martin Schwenke2013-05-061-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This has 2 advantages: 1. It uses get_tcp_connections_for_ip() to check for leftover connections, instead of custom code. 2. It checks for the timeout condition before sleeping. The current code sleeps and then checks, so wastes a second. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 60a08eb96e1d97aab31e9bd4af01683c650541c2)
| * eventscripts: In killtcp/tickle functions, $_failed should be booleanMartin Schwenke2013-05-061-13/+12
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 319c1b68d5aa78f82a68febcad233a7c78afc887)
| * eventscripts: Remove unused $_killcount from tickle_tcp_connections()Martin Schwenke2013-05-061-2/+0
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 8514ca56830b30e7f0eb5018632640daaf8ff65d)
| * eventscripts: Refactor connection listing in killtcp and tickle functionsMartin Schwenke2013-05-061-51/+58
| | | | | | | | | | | | | | | | | | Uses new function get_tcp_connections_for_ip(). This avoids using a temporary file and running netstat twice. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a621622903c7ef17764b15293d6ea8df5a53c7e1)