summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * client: async_callback() sets result to -ETIME if a control times outMartin Schwenke2013-05-241-0/+5
| | | | | | | | | | | | | | | | | | | | Otherwise there is no way of treating a timeout differently to a general failure. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 40e34773b8063196457746ffe7a048eb87d96d61)
| * ctdbd: Update the get_tunable code to return -EINVAL for unknown tunableMartin Schwenke2013-05-243-3/+3
| | | | | | | | | | | | | | | | | | 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)
| * recoverd: Whitespace improvementsMartin Schwenke2013-05-241-10/+10
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 473cfcb019f0cb4a094bf10397f7414f7923ee57)
| * recoverd: Use talloc_array_length() for simpler codeMartin Schwenke2013-05-241-8/+8
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit f6792f478197774d2f3b2258c969b67c83e017ab)
| * ctdbd: When the "setup" event fails log an error and exit, don't abortMartin Schwenke2013-05-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | The "setup" event can fail when one of the eventscripts fails to run its "setup" event. If this occurs then the eventscript should log an error. The stack trace and core file generated when we abort provides no useful information. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c50eca6fbf49a6c7bf50905334704f8d2d3237d7)
| * eventscripts: 11.natgw should not call ctdb tool in "init" eventMartin Schwenke2013-05-241-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | The current code calls "ctdb setnatgwstate ..." on every event. However, calling the ctdb tool in the "init" event is not permitted. Instead, update the capability when it is needed and at regular intervals via the "monitor" event. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 39a43feae7c7de07ddaf2d6cb962f923d47d0c19)
| * ctdbd: Add new runstate CTDB_RUNSTATE_FIRST_RECOVERYMartin Schwenke2013-05-248-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-244-4/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-242-0/+38
| | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit bf20c3ab090f75f59097b36186347cedb1c445d4)
| * ctdbd: New control CTDB_CONTROL_GET_RUNSTATEMartin Schwenke2013-05-244-0/+43
| | | | | | | | | | | | | | | | Also new client function ctdb_ctrl_get_runstate(). Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit dc4220e6f618cc688b3ca8e52bcb3eec6cb55bb1)
| * ctdbd: Start logging process earlierMartin Schwenke2013-05-241-7/+6
| | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit f43fe3a560d5915c1a9893256f4e7bfe3d7e290a)
| * ctdbd: Only start recovery daemon and timed events after setup eventMartin Schwenke2013-05-241-21/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This deconstructs ctdb_start_transport(), which did much more than starting the transport. This removes a very unlikely race and adds some clarity. The setup event is supposed to set the tunables before the first recovery. However, there was nothing stopping the first recovery from starting before the setup event had completed. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit c31feb27dcdb748b5333321c85fe54852dfa1bcf)
| * ctdbd: Replace ctdb->done_startup with ctdb->runstateMartin Schwenke2013-05-247-11/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows states, including startup and shutdown states, to be clearly tracked. This doesn't include regular runtime "states", which are handled by node flags. Introduce new functions ctdb_set_runstate(), runstate_to_string() and runstate_from_string(). Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 8076773a9924dcf8aff16f7d96b2b9ac383ecc28)
| * 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)
| * logging: Make sure ringbuffer messages are terminated with a newlineAmitay Isaacs2013-05-241-0/+6
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit dbb7c550133c92292a7212bdcaaa79f399b0919b)
| * tests: Fix output of run_tests usageAmitay Isaacs2013-05-241-2/+2
| | | | | | | | (This used to be ctdb commit 29911fa44a480c17c701528ef46919b2a962a366)
| * locking: Set lock helper path onceAmitay Isaacs2013-05-241-6/+13
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 80fbe9364350d42658f7f8af250ac87eb1afbc21)
| * locking: Remove functions that are not used anymoreAmitay Isaacs2013-05-242-86/+0
| | | | | | | | | | | | | | | | | | These functions were used in locking child process to do the locking. With locking helper, these are not required. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit c660f33c3eaa1b4a2c4e951c1982979e57374ed4)
| * locking: Remove functions that are not used anymoreAmitay Isaacs2013-05-241-91/+0
| | | | | | | | | | | | | | | | | | These functions were used in locking child process to do the locking. With locking helper, these are not required. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 6ea3212a7b177c6c06b1484cf9e8b2f4036653d9)
| * locking: Use separate locking helper binary for lockingAmitay Isaacs2013-05-243-18/+41
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 7cde53a6cbe74b1e46f7e1bca298df82c08de866)
| * locking: Create commandline arguments for locking helperAmitay Isaacs2013-05-241-0/+115
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit f665e3d540c90579952e590caa5828acb581ae61)
| * locking: Add a standalone helper to lock record/dbAmitay Isaacs2013-05-243-1/+156
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit a08b6ac19506160f3fb5925ea025027dce07781d)
| * locking: Use database iterator for unmarking databasesAmitay Isaacs2013-05-241-17/+2
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 7630ca4116b476636c27407748088ea335f1a06c)
| * locking: Add handler function for unmarking a databaseAmitay Isaacs2013-05-241-0/+23
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit adc113055de98fae276f9b501aff5c03cd25ddc8)
| * locking: Use database iterator for marking databasesAmitay Isaacs2013-05-241-39/+2
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit e8ea65b2713417db4a618a9f4633991cfaa93fe6)
| * locking: Add handler function for marking a databaseAmitay Isaacs2013-05-241-0/+23
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit f120e40533780e02ff1cdc41cc6d3af1c4c83258)
| * locking: Use database iterator for unlocking databasesAmitay Isaacs2013-05-241-17/+2
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 187ed83f9701c7fa8d3cc476d47c5d2a87d5c308)
| * locking: Add handler function for unlocking a databaseAmitay Isaacs2013-05-241-0/+20
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 725239535f40ca2cca445bb5bf2e181351b330e9)
| * 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)