summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* server:persistent: fix a comment typo.Michael Adam2013-02-221-1/+1
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit 6455ce5e4980a63d56ed30f7059869c8356c12ea)
* recoverd: update_capabilities() should use connected nodesMartin Schwenke2013-02-201-1/+1
| | | | | | | | | ... as the comment says... not just active nodes. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 4f71dca8df19a63f198e2d6d59e605b49ec5e803)
* client: Refactor node listing functions to use list_of_nodes()Martin Schwenke2013-02-201-81/+5
| | | | | | | | | This reduces repetition. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit f505020a5720faa4ecc6414e0bfaa6b3c0e47291)
* client: New generic node listing function list_of_nodes()Martin Schwenke2013-02-202-0/+43
| | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit a73bb56991b8c07ed0e9517ffcf0dc264be30487)
* common/io: Rewrite socket handling code to read all available dataAmitay Isaacs2013-02-191-68/+92
| | | | | | | | | | | | | This improves the processing of packets considerably. It has been observed that there can be as many as 10 packets in the socket buffer and the current code of reading a single packet from a socket at a time is not very optimal. This change reads all the bytes from socket buffer and then parses to extract multiple packets. If there are multiple packets, set up a timed event to process next packet. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit d788bc8f7212b7dc1587ae592242dc8c876f4053)
* doc: Fix typo in ctdbd manpageMartin Schwenke2013-02-151-1/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 855ab348901edb3ec1327499a43f509d279b8182)
* ctdbd: Fix the PullDBPreallocation size to 10MB as intendedAmitay Isaacs2013-02-141-1/+1
| | | | | | | | | | In 1f262deaad0818f159f9c68330f7fec121679023, Ronnie changed recovery code to allocate chunks of 10MB in traverse_pulldb() and traverse_recdb(). The tunable PullDBPreallocation size was set to 100MB. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit e204fac03412520e877ab04363b3ece02667c55b)
* eventscripts: Remove calls to "smbstatus -np" for samba cleanupAmitay Isaacs2013-02-111-29/+3
| | | | | | | | | | This is an artifact from older versions of Samba. In the newer versions of Samba, "smbstatus -np" command does not do anything useful, but causes a traverse in CTDB which is expensive and causes CPU utilization to shoot up. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 053b89c6dbce47001505524606889334559d2ec4)
* Logging: Fix breakage when freeing the log ringbufferMartin Schwenke2013-02-074-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit a82d3ec12f0fda16d6bfa8442a07595de897c10e broke fetching from the log ringbuffer. The solution there is still generally good: there is no need to keep the ringbuffer in children created by ctdb_fork()... except for those special children that are created to fetch data from the ringbuffer! Introduce a new function ctdb_fork_no_free_ringbuffer() that does everything ctdb_fork() needs to do except free the ringbuffer (i.e. it is the old ctdb_fork() function). The new ctdb_fork() function just calls that function and then frees the ringbuffer in the child. This means all callers of ctdb_fork() have the convenience of having the ringbuffer freed. There are 3 special cases: * Forking the recovery daemon. We want to be able to fetch from the ringbuffer there. * The ringbuffer fetching code. Change the 2 calls in this code (main daemon, recovery daemon) to call ctdb_fork_no_free_ringbuffer() instead. While we're here, clear the log ringbuffer when the recovery deamon is forked, since it will contain a copy of the messages from the main daemon. Note to self: always test... even the most obvious patches... ;-) Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 00db5fa00474f8a83f1aa3b603fd756cc9b49ff4)
* Fix a comment typoVolker Lendecke2013-02-061-1/+1
| | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit b940e3a24daa73ca9b2896b7a449240136442b53)
* initscript: export CTDB_EXTERNAL_TRACEMartin Schwenke2013-02-051-1/+1
| | | | | | | | | This means it can be set like any other configuration option in the configuration file, without needing to export it there. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a0ef73e197dc9147f7718e0813fe803ff0b3d54d)
* ctdbd: Don't use a fixed length buffer for the hung script commandMartin Schwenke2013-02-051-2/+4
| | | | | | | | | The amount of data to write into the buffer wasn't constrained anywhere... Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9b0d56b16775aa16f33bdfdf831256e085fa3339)
* ctdbd: Complain loudly if CTDB_DEBUG_HUNG_SCRIPT script isn't executableMartin Schwenke2013-02-051-12/+0
| | | | | | | | | | | | | | | | | | This is quite easy to misconfigure by failing to set the execute bit on the script. Better to complain loudly. This is a debugging facilty rather than core CTDB functionality, so it doesn't need a subtle mechanism to disable it at run-time. To disable the designated script at run-time either edit it to put an "exit 0" at the top or move it aside and symlink to /bin/true. This is implemented by actually removing the code that checks that the file exists and is executable. The output from the shell when the system() function fails is just as useful. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 3400b2ed34b6eb9496eb55f1aab6f89d2952060d)
* ctdbd: Remove command-line option --debug-hung-scriptMartin Schwenke2013-02-054-28/+16
| | | | | | | | | | | | | | | Use an environment variable instead. This just means that the initscript exports CTDB_DEBUG_HUNG_SCRIPT and the code checks for the environment variable. The justification for this simplification is that more debug options will be arriving soon and we want to handle them consistently without needing to add a command-line option for each. So, the convention will be to use an environment variable for each debug option. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0581f9a84e58764d194f4e04064c2c5b393c348b)
* ctdbd: Remove debug_hung_script_ctxMartin Schwenke2013-02-052-4/+1
| | | | | | | | | | The only allocation against this context is by ctdb_fork_with_logging(). This memory is freed by ctdb_log_handler() anyway. There should be no memory leak. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 501461cc3e132d4adee9e91b5d4513a26bae2846)
* ctdbd: Message logged at exit should be different for different processesMartin Schwenke2013-02-051-1/+5
| | | | | | | | | | Some subprocesses print "CTDB daemon shutting down" when they exit and this can be confusing. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit f1ffe1112b7e342d7f1228ca816a8e5918f893cf)
* daemon: Make sure all the traverse children are terminated if traverse times outAmitay Isaacs2013-02-051-3/+11
| | | | | | | | | | | | | | When traverse times out, callback function is called with key and data set to tdb_null. This is also the way to signal end of traverse. So if the traverse times out, callback function treats it as traverse ended and frees state without calling the destructor. Keep track if the traverse timed out, so callback function can take appropriate action for traverse timeout and traverse end. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 35da9a7c2a0f5e54e61588c3c3455f06ebc66822)
* Logging: Free the ringbuffer in child processes created with ctdb_fork()Martin Schwenke2013-02-051-0/+3
| | | | | | | | | | | | At the moment the log ringbuffer is duplicated in every child process. Althought it is copy-on-write we want to see if it is contributing to out-of-memory situations when there are a lot of children. The ringbuffer isn't accessible from any of the children anyway... Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a82d3ec12f0fda16d6bfa8442a07595de897c10e)
* Logging: New function ctdb_log_ringbuffer_free()Martin Schwenke2013-02-052-2/+9
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a4f622e85168f59417c11705f1734e0352e1d44a)
* build: Fix a Makefile.in typoMartin Schwenke2013-02-051-1/+1
| | | | | | | | Objects are named *.o ;-) Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 25a20409fb39a94b64c13990c0eba4f75d482ecd)
* 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)
* recoverd: Fix printing of node flags from local informationAmitay Isaacs2013-01-231-1/+1
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 124e2a471aeda9c900fd898178a30522d7d74221)
* common: Don't lie on unimplemented gratuitous arpMathieu Parent2013-01-224-5/+5
| | | | | | Signed-off-by: Mathieu Parent <math.parent@gmail.com> (This used to be ctdb commit b054193d1d19a8eef998fa690899501f79badb8a)
* tests: Test portabilityMathieu Parent2013-01-222-0/+310
| | | | | | | | Curiously test_ctdb_sys_check_iface_exists fails on Linux Signed-off-by: Mathieu Parent <math.parent@gmail.com> (This used to be ctdb commit 109f428aa34f8f4cc0329880d2f4a5593a6cc6f3)
* common: FreeBSD+kFreeBSD: Implement get_process_name (same as in Linux)Mathieu Parent2013-01-222-3/+30
| | | | | | Signed-off-by: Mathieu Parent <math.parent@gmail.com> (This used to be ctdb commit 258092aaf6b7a9bdc14f0fb35e8bd7f7dc742b3f)
* common: Detailed platform-specific FIXMEMathieu Parent2013-01-224-18/+22
| | | | | | Signed-off-by: Mathieu Parent <math.parent@gmail.com> (This used to be ctdb commit d202b2fdd4fd70172e5e44583627b57a1b7ad2ed)
* build: Update config.guess 2012-12-30 and config.sub to 2013-01-11Mathieu Parent2013-01-222-301/+399
| | | | | | Signed-off-by: Mathieu Parent <math.parent@gmail.com> (This used to be ctdb commit 3c6a9b73364c9543366fa033c778145dc7a152a9)
* doc: allows to -> allows one toMathieu Parent2013-01-222-2/+2
| | | | | | Signed-off-by: Mathieu Parent <math.parent@gmail.com> (This used to be ctdb commit 95fc493a7d4145f976cb3fe928d9e92faec4dd71)
* build: Add missing LDFLAGSMathieu Parent2013-01-221-2/+2
| | | | | | | | Original Author: Simon Ruderich <simon@ruderich.org> Signed-off-by: Mathieu Parent <math.parent@gmail.com> (This used to be ctdb commit 506ecd186759675a1cf50a0a05a285fee03fc51e)
* Changes for unobtrusive recovery and new method for health check.Srikrishan Malik2013-01-113-75/+156
| | | | | | | | | | | | Unobtrusive recovery: Ganesha will not be restarted on failovers. Ganesha health: Use the counters in /var/lib/nfs/ganesha_local to track progress instead of the null call which can timeout if the server is too busy. Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com> Signed-off-by: Lance Russell <lancerus@us.ibm.com> (This used to be ctdb commit 0e651e9da0f1f3c836b4474612ab13d0ccd272d9)
* recoverd: Create recoverd monitoring timed events off recoverd contextAmitay Isaacs2013-01-091-1/+1
| | | | | | | | | | This ensures that when shutting down CTDB, all the timed events associated with monitoring recoverd are destroyed and recoverd is not restarted. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 7393e2b290f9879ff72d5c5a9ce933034129f0e8)
* daemon: Protect against double free of callback state while shutting downAmitay Isaacs2013-01-093-2/+11
| | | | | | | | | | | | | | | | When CTDB is shut down and monitoring has been stopped, monitor_context gets freed and all the callback states hanging off it. This includes callback state for current_monitor, if the current monitor event has not yet finished. As a result, when the shutdown event is called, current_monitor->callback state is not NULL, but it's actually freed and it's a dangling reference. So before executing callback function and freeing callback state check if ctdb->monitor->monitor_context is not NULL. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 7d8546ee4353851f0543d0ca2c4c67cb0cc75aea)
* daemon: On shutdown, destroy timed events that check if recoverd is activeAmitay Isaacs2013-01-093-7/+15
| | | | | | | | | | | | | | | | | | | | | When CTDB is shutting down, recovery daemon is stopped, but the event that checks if recovery daemon is still alive is not destroyed. So recovery master is restarted during shutdown if CTDB daemon takes longer to shutdown. There are two processes that check if recovery daemon is working. 1. ctdb_check_recd() - which checks every 30 seconds if the recovery daemon process exists. 2. ctdb_recd_ping_timeout() - which is triggered when recovery daemon fails to ping CTDB daemon. Both the events are periodic and need to be destroyed when shutting down. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 746168df2e691058e601016110fae818c6a265c3)
* tests: Add a test for recovery of persistent databasesAmitay Isaacs2013-01-091-0/+119
| | | | | | | | | | Ensure that RSN based recovery and __db_sequence_number__ based recovery methods for persistent databases work correctly. They should not cause corruption of the database. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 45d439a1ab093b420c27b1502ef109021833c7af)
* 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)
* daemon: Update the comment and remove redundant check in ctdb_start_transport()Amitay Isaacs2013-01-091-6/+1
| | | | | | | | | | | | | ctdb_start_transport() is called just before "setup" event, when CTDB is ready to process the requests. "startup" event happens much later after a successful recovery. Transport method ctdb->methods is successfully initialized before ctdb_start_transport() is called. No need to check again. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 9a70a4d23d00f6cb996c061ba3dfb7c47b4f6a4f)
* eventscripts: Fail the setup event if CTDB does not become readyMartin Schwenke2013-01-091-4/+3
| | | | | | | | Currently it silently continues without attempting to set tunables. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 735ec99b99c7bb579851ce8293011aaf1dcc552a)
* scripts: Make script_log() use supplied message, stop logger from hangingMartin Schwenke2013-01-081-1/+1
| | | | | | | | | | When using syslog any provided message arguments are ignored and not passed to logger. This means that logger blocks waiting on stdin. That's bad. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 50abf597cefe6f8ea2a2ff7694bf84641344a9b1)
* scripts: Rework ctdb-crash-cleanup.sh so that it uses existing functionsMartin Schwenke2013-01-081-32/+17
| | | | | | | | This improves maintainability. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit e2aaa64925cca359c71520e01a18fc9461b0da4d)
* scripts: Make drop_all_public_ips() more robustMartin Schwenke2013-01-081-3/+32
| | | | | | | | | | | | Incorporate some of the logic from ctdb-crash-cleanup.sh that ensures IPs are deleted even if they have the wrong netmask or are on the wrong interface. Factoring out some of the code will allow it to be used elsewhere. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 03356fd5ae7a3ac35fde0289cbea7c71ecf07367)
* ctdbd: Default value for debug_hung_script should use ETCDIRMartin Schwenke2013-01-081-1/+1
| | | | | | | | | That is, it should use whatever was specified in ./configure and should not hardcode /etc. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 13e5e609b262847b607e7af7e0685f44e7cb8e36)
* scripts: debug-hung-script.sh doesn't need functions/loadconfigMartin Schwenke2013-01-081-3/+0
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 8507303b525d20c74e8ec4e7c4f5f275945cd3b6)
* scripts: statd-callout should calculate CTDB_BASE if it is not setMartin Schwenke2013-01-081-3/+2
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 376015ba5ad6b7703ae9949a1d40a0c72dfaba0c)
* eventscripts: Each script should set CTDB_BASE if it is not setMartin Schwenke2013-01-0819-0/+57
| | | | | | | | This makes it easier to run the scripts externally. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 740ea8ea5084149c8b552a01ee1c98c558b12384)
* scripts: Move drop_all_public_ips() to the functions fileMartin Schwenke2013-01-082-6/+6
| | | | | | | | ... so it can be improved and used elsewhere. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b23c30253cc9eb274b895cac0f8c65245ba0a200)
* tests/simple: Add test to check recovery daemon IP verificationMartin Schwenke2013-01-082-6/+121
| | | | | | | | Also update ips_are_on_nodeglob() to handle negation. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 13a5944f8a27d43006acfffba76958693cae7702)
* tests/eventscripts: Ratchet down debug level for ctdb_takeover_testsMartin Schwenke2013-01-081-1/+2
| | | | | | | | | | | | | | The default IP allocation algorithm used by ctdb_takeover_tests changed from "non-deterministic IPs" to "LCP2". The latter generates a lot more debug output. ctdb_takeover_tests is used by the ctdb tool stub to calculate IP address changes for failovers. This resulted in unexpected debug output that caused tests to fail. Since eventscript tests don't care how IP allocations are arrived at, the best solution is to turn down the debug level. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 3cc596d2b459d834f9785b3a98027e46431ff2b9)
* recoverd: Separate each IP allocation algorithm into its own functionMartin Schwenke2013-01-081-66/+96
| | | | | | | | | | This makes the code much more readable and maintainable. As a side effect, fix a memory leak in LCP2. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 6a1d88a17321f7e1dc84b4823d5e7588516a6904)