summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| | | * tests: temporarily disable the transaction test tool.Michael Adam2009-12-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make it return success for make test. This is temporarily disabled until the rewrite of the transaction code (in samba and the daemon) using the global lock feature has been ported to the ctdb client code. Michael (This used to be ctdb commit 78ca29352aa39f4ef4e41096b92d55cb2e0d348a)
| | | * Add a new control CTDB_GET_DB_SEQNUM - fetch a persistent db's sequence number.Michael Adam2009-12-123-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | Michael (This used to be ctdb commit a7e3b5fac6b3f5d74473f26eb86c067b35647996)
| | | * define CTDB_DB_SEQNUM_KEY - used with the new implementation of transactions.Michael Adam2009-12-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Michael (This used to be ctdb commit 4b1dbcf0853bdc4832d39a477823ae34f216da52)
| | | * Tiny simplification of ctdb_queue_packet()Volker Lendecke2009-12-121-9/+11
| | | | | | | | | | | | | | | | (This used to be ctdb commit 1640da1cab7e8b545367824204c82931f3346848)
| | | * Rename a struct member for clarityVolker Lendecke2009-12-122-4/+4
| | | | | | | | | | | | | | | | (This used to be ctdb commit 6af5e74a21546d723008d69d6752ebebf898c947)
| | | * server: add a new control CTDB_CONTROL_TRANS3_COMMITMichael Adam2009-12-123-0/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a simplified version of the trans2 commit control: It just rolls out the marshall buffer to all active nodes. It is the main ctdbd part of the re-implementation of the persistent transactions. The client code is changed to take a global lock to start a transactions and store into the marshal buffer instead of writing to the local tdb under a local transaction. The old transaction implementation is going to be removed in a later commit. Michael (This used to be ctdb commit f66428f9d2013080a414404c1ba6117888352fd6)
| * | | Author: Rusty Russell <rusty@rustcorp.com.au>Ronnie Sahlberg2009-12-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Date: Tue Dec 15 15:53:30 2009 +1030 eventscript: hack to avoid overloading valgrind Now we fork one child per script, when running under valgrind the load gets quite high. This is because valgrind does a lot of work after exit, and we don't wait for the children to finish; we start the next one when the child reports status via the pipe. This fix is ugly, but simple. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 6ed34d5320c39d8a55f2a36ad4c1ab574e0b0796)
| * | | This is a dodgy patch.Ronnie Sahlberg2009-12-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I saw once where the master ctdbd logging structure was talloc freed which caused issues. So only free the structure if it is NOT the master structure. This needs to be looked into in more detail. (This used to be ctdb commit bcf494b81f4277dc75f05faccf0c446bd15f6e2b)
| * | | add a new test tool that just locks and releases the same record over and overRonnie Sahlberg2009-12-152-1/+146
| | | | | | | | | | | | | | | | (This used to be ctdb commit 24767be2eb9aed29704c2a4097bab5466cb6728f)
| * | | ctdb_fetch requires the number of nodes being specified.Ronnie Sahlberg2009-12-151-0/+5
| |/ / | | | | | | | | | | | | | | | Have it log an error and terminate if thie parameter was omitted (This used to be ctdb commit 340be0179f55acfff77f8c3c8be958679227bde1)
* | | Test suite: Add an optimisation in the getvar test.Martin Schwenke2009-12-181-1/+1
| | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d9105ea79df198a20c2bfe471c4793d1dbba886e)
* | | Test suite: allow settign of timeout triggers for all events not just monitor.Martin Schwenke2009-12-181-11/+34
|/ / | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit f319bd54369a2bc7d32c3bda7fc22f2ef1a51c3a)
* | When setting up the logging, set the event to trigger a read of a log ↵Ronnie Sahlberg2009-12-151-1/+1
| | | | | | | | | | | | | | | | message from a child process as a child of the "log" structure and not the ctdb structure, or else we can crash if we receive log messages from a child but the log structure has been freed() (This used to be ctdb commit ea9e39369379939abf6a4076fa2014c10c1a9ad0)
* | From rusty:Ronnie Sahlberg2009-12-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Subject: eventscript: fix spinning at 100% cpu when child exits. ctdbd was spinning reading 0 from a pipe, as soon as the first eventscript finishes. This was caused by the intersection between a78b8ea7168e "Run only one event for each epoll_wait/select call" and 32cfdc3aec34 "eventscript: ctdb_fork_with_logging()". Unavoidable mid-air collision, since both worked fine and both were developed simultaneously. When the script exits, we have two pipes open to it: one for any stdout/stderr for logging (ctdb_log_handler), and one for the result (ctdb_event_script_handler). The latter frees everything, including the log fd and event structure. We used to get one callback to ctdb_log_handler, which got a harmless 0-length read, then one to ctdb_event_script_handler which cleaned up. Now we only do one callback per poll, we need the logging function to clean itself up so we can make process. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 211ea7907e8e96041aa6f7d086551d64d065a8a3)
* | Rename the tunable EventScriptBanCount to EventScriptTimeoutCountRonnie Sahlberg2009-12-143-4/+4
| | | | | | | | | | | | | | | | since we no longer ban nodes when dodgy scripts continue to hang. We now only mark nodes as unhealthy if monitor events fail or timeout. Never ban. (This used to be ctdb commit 5c8e56fc7a518e115bceac257867739283cf6a1e)
* | cleanup: remove a tunable we no longer use in the eventscripts any more :Ronnie Sahlberg2009-12-142-2/+0
| | | | | | | | | | | | EventScriptUnhealthyOnTimeout (This used to be ctdb commit 401f421fa003d9515df15e759b50b56e0c67d69c)
* | ctdb: don't print OUTPUT: for DISABLED scriptsRusty Russell2009-12-141-4/+6
| | | | | | | | | | | | | | | | In other news, did you know ctime() returns a \n-terminated string? Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 1b4e7bb548976b99f122142b040494b6f9911962)
* | eventscript: fix monitoring when killed by another script commandRusty Russell2009-12-141-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit c1ba1392fe "eventscript: get rid of ctdb_control_event_script_finished altogether" was wrong: there is one case where we want to free the script without transferring their status to last_status. This happens because we always kill an running monitor command when we run any other command. This still isn't quite right (and never was): the callback will be called with status value 0, which might flip us to HEALTHY if we were unhealthy. This is conveniently fixed in my next set of patches :) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 0ea0e27d93398df997d3df9d8bf112358af3a4a5)
* | remove the variable "disable when unhealthy"Ronnie Sahlberg2009-12-143-6/+0
|/ | | | | | there is no rational need for a setting where we permanently mark nodes as disabled everytime an eventscript fails (This used to be ctdb commit 68a8ee99b128a5ec883600735626bdb3bbc9c503)
* From: Volker Lendecke <vl@samba.org>Ronnie Sahlberg2009-12-101-2/+0
| | | | | | | Date: Wed, 9 Dec 2009 22:45:12 +0100 Subject: [PATCH] Revert an accidential commit (This used to be ctdb commit af6656f2844d8fd72204a70358c9d589dbe1bd34)
* tests: remove the no_trans mode from ctdb_transaction.Michael Adam2009-12-091-58/+34
| | | | | | | | | Writes without transaction are not possible any more on persistent databases. Michael (This used to be ctdb commit 59f46d7261dfdbdef900bf95dd9eb28ad22a46b2)
* tests: remove the persistent_unsafe writes test.Michael Adam2009-12-091-39/+0
| | | | | | | | | This is useless now that persistent write operations without transaction are forbidden. Michael (This used to be ctdb commit b022863d44026c19d5aae54aa485b670bea0540e)
* tests: remove persistent_safe write test.Michael Adam2009-12-091-39/+0
| | | | | | | | This is useless now that persistent writes without transactions are forbidden. Michael (This used to be ctdb commit 9ac82311d796e1fab31f8de62b8ccc754445093c)
* test: add test 54_ctdb_transaction_recovery.shMichael Adam2009-12-091-0/+66
| | | | | | | | | | | | | | | This is like the 53_ctdb_transaction test, but it additionally runs a loop with recoveries while the transactions are running. When called like this, the transaction loops run for 10 minutes: CTDB_TEST_TIMELIMIT=600 tests/scripts/run_tests tests/simple/54_ctdb_transaction_recovery.sh The default timelimit is 30 seconds. Michael (This used to be ctdb commit 2ff2679e8f3d50ebf735f2c420898a84268bdc95)
* test: get value for --timelimit from environment var CTDB_TEST_TIMELIMIT in ↵Michael Adam2009-12-091-1/+5
| | | | | | | | transaction test Michael (This used to be ctdb commit c13077ca64f6e6569c30ef7fcb044e5711dce1a3)
* client: lower level of commit retry message WARNING->DEBUGMichael Adam2009-12-091-3/+3
| | | | | | | | This can happen frequently when recoveries intercept transactions. Michael (This used to be ctdb commit c46adb210e47530488503e20d682d4d182c0fb79)
* client: lower debug level of transaction-active-retry message to DEBUGMichael Adam2009-12-091-4/+4
| | | | | | | | This reduces some noise. Michael (This used to be ctdb commit 54d227811753f4a87f1a2c9dc0b1389f5ca2a12f)
* call: lower the debug message "refusing migration while transction" to lvl INFOMichael Adam2009-12-091-1/+1
| | | | | | | | | This gets just too noisy on a busy system. And it is purley informational anyways... Michael (This used to be ctdb commit 7f64a00c76203fdf6673c3f862a4bfd17fb848d7)
* Run only one event for each epoll_wait/select callVolker Lendecke2009-12-105-8/+5
| | | | | | | | This might be a bit less efficient, but experience in winbind has shown that event callbacks can trigger changes in the socket state in very hard to diagnose ways. (This used to be ctdb commit a78b8ea7168e5fdb2d62379ad3112008b2748576)
* reduce vacuuming lognoiseChristian Ambach2009-12-101-6/+6
| | | | | | | | | | | | | | syslog.h says: LOG_NOTICE 5 normal but significant condition LOG_INFO 6 informational several vacuuming related logs logged at NOTICE level although I don't see any real significance, these are just informational messages for me Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com> (This used to be ctdb commit 142111983c103e90ccccbe26fd580c4eb28e949f)
* improve time jump loggingChristian Ambach2009-12-103-6/+6
| | | | | | | | | add the __location__ macro to the logs to get a better idea in which loop the problem occured Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com> (This used to be ctdb commit dccb549fd6a6e338063699544e52f2a1a6a966b5)
* Merge commit 'rusty/script-report'Ronnie Sahlberg2009-12-0913-765/+645
|\ | | | | | | (This used to be ctdb commit 6e8b279ed307eccac08386e98510361ba3ab3d36)
| * ctdb: scriptstatus can now query non-monitor eventsRusty Russell2009-12-086-31/+101
| | | | | | | | | | | | | | | | | | | | | | | | We also no longer return an error before scripts have been run; a special zero-length data means we have never run the scripts. "ctdb scriptstatus all" returns all event script results. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 9b90d671581e390e2892d3a68f3ca98d58bef4df)
| * eventscript: expost call names and enumRusty Russell2009-12-084-39/+45
| | | | | | | | | | | | | | | | | | We're going to need this so ctdb can query non-monitor status. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 53bc5ca23ca55a3ac63a440051f16716944a2a51)
| * eventscript: lock logging on timeout.Rusty Russell2009-12-081-1/+2
| | | | | | | | | | | | | | | | | | Ronnie suggested this; seems like a very good idea. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 93153bca68926401dc9ae7fd77ed3f17be923344)
| * ctdb: support --machinereadable (-Y) for scriptstatusRusty Russell2009-12-081-1/+17
| | | | | | | | | | | | | | Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 47ffe75848f216568ce3db0a60ca88cfe3d6903a)
| * eventscript: get rid of ctdb_control_event_script_finished altogetherRusty Russell2009-12-081-22/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We always have to call it before freeing the state; we should just do this work in the destructor itself. Unfortunately, the script state would already be freed by the time the state destructor is called, so we make the script state a child of ctdb, and talloc_free() it manually on the one path which doesn't use the destructor. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit c1ba1392fe52762960e896ace0aca0ee4faa94d5)
| * eventscript: save state for all script invocationsRusty Russell2009-12-082-33/+26
| | | | | | | | | | | | | | | | | | | | Rather than only tranferring to last_status for monitor events, do it for every event (ctdb->last_status is now an array). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit c73ea56275d4be76f7ed983d7565b20237dbdce3)
| * eventscript: cleanup finished to take state argRusty Russell2009-12-081-15/+10
| | | | | | | | | | | | | | | | | | | | | | We only need ctdb->current_monitor so we can kill it when we want to run something else; we don't need to use it here as we always know what script we are running. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 4cf1b7c32bcf7e4b65aec1fa7ee1a4b162cac889)
| * eventscript: use wire format internally for script status.Rusty Russell2009-12-081-71/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only difference between the exposed an internal structure now is that the name and output fields were pointers. Switch to using ctdb_scripts_wire/ctdb_script_wire internally as well so marshalling is a noop. We now reject scripts which are too long and truncate logging to the 511 characters we have space for (the entire output will be in the normal ctdbd log). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit fd2f04554e604bc421806be96b987e601473a9b8)
| * eventscript: rename ctdb_monitoring_wire to ctdb_scripts_wireRusty Russell2009-12-085-11/+11
| | | | | | | | | | | | | | | | | | | | We're going to allow fetching status of all script runs, so this name is no longer appropriate. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit f5cb41ecf3fa986b8af243e8546eb3b985cd902a)
| * eventscript: get_current_script() helperRusty Russell2009-12-081-10/+15
| | | | | | | | | | | | | | | | | | | | This neatens the code slightly. We also use the name 'current' in ctdb_event_script_handler() for uniformity. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit e9661b383e0c50b9e3d114b7434dfe601aff5744)
| * eventscript: use an array rather than a linked list of scriptsRusty Russell2009-12-081-94/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This brings us closer to the wire format, by using a simple array and a 'current' iterator. The downside is that a 'struct ctdb_script' is no longer a talloc object: the state must be passed to our log fn, and the current script extracted with &state->scripts->scripts[state->current]. The wackiness of marshalling is simplified, and as a bonus, we can distinguish between an empty event directory (state->scripts->num_scripts == 0) and and error (state->scripts == NULL). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 76e8bdc11b953398ce8850de57aa51f30cb46bff)
| * eventscript: record script status for all eventsRusty Russell2009-12-081-83/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This unifies almost everything: the state->current pointer points to the struct ctdb_script where we record start, finish, status and output. We still only marshall up the monitor events; the rest disappear when the state structure is freed. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit c476c81f3e3d8fc62f2e53d82fce5774044ee9ce)
| * eventscript: use scripts array directly, rather than separate listRusty Russell2009-12-081-50/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We rename ctdb_monitor_script_status to ctdb_script, and instead of allocating them as the scripts are executed, we allocate them up front and keep a "current" interator. This slightly simplifies the code, though it means we only marshall up to the last successfully run script. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit b2a300768536d10bd867a987ad4cf1c5268c44bc)
| * eventscript: ctdb_fork_with_logging()Rusty Russell2009-12-083-34/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A new helper functions which sets up an event attached to the child's stdout/stderr which gets routed to the logging callback after being placed in the normal logs. This is a generalization of the previous code which was hardcoded to call ctdb_log_event_script_output. The only subtlety is that we hang the child fds off the output buffer; the destructor for that will flush, which means it has to be destroyed before the output buffer is. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 32cfdc3aec34272612f43a3588e4cabed9c85b68)
| * eventscript: pass struct ctdb_log_state directly to ctdb_log_handler().Rusty Russell2009-12-081-17/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current logging logic assumes that any stdout/stderr belongs to the currently running monitor script output. This isn't quite right anyway, and we'd like to capture stderr output of other script invocations. So we move towards multiple struct ctdb_log_state by handing it directly to ctdb_log_handler to use, rather than having it assume ctdb->log. We need a ctdb pointer inside the log struct now though. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 497766cf186442de00fb324343150442457be858)
| * eventscript: remove unused ctbd_ctrl_event_script*Rusty Russell2009-12-084-179/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The child no longer uses ctdb_ctrl_event_script_init or ctdb_ctrl_event_script_finished, and the others are redundant: it doesn't need to tell us it's starting a script when it only runs one. We move start and stop calls to the parent, and eliminate the RPC infrastructure altogether. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 391926a87a7af73840f10bb314c0a2f951a0854c)
| * eventscript: refactor forking code into fork_child_for_script()Rusty Russell2009-12-081-77/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | We do the same thing in two places: fire off a child from the initial ctdb_event_script_callback_v() and also from the ctdb_event_script_handler() when it's done. Unify this logic into fork_child_for_script(). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 814704a3286756d40c2a6c508c1c0b77fa711891)
| * eventscript: fork() a child for each script.Rusty Russell2009-12-081-59/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We rename child_run_scripts() to child_run_script(), because it now runs a single script rather than walking the list. When it's finished, we fork the next child from the ctdb_event_script_handler() callback. ctdb_control_event_script_init() and ctdb_control_event_script_finished() are now called directly by the parent process; the child still calls ctdb_ctrl_event_script_start() and ctdb_ctrl_event_script_stop() before and after the script. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 0fafdcb8d3532a05846abaa5805b2e2f3cee8f47)