summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * Revert "client: handle transient connection errors"Amitay Isaacs2013-04-051-30/+5
| | | | | | | | | | | | | | | | | | This reverts commit dc0c58547cd4b20a8e2cd21f3c8363f34fd03e75. There is a simpler solution that retrying random number of times. Do not set socket non-blocking till connect succeeds. (This used to be ctdb commit 74acc2c568300ef42740cf11299a1b2507047f60)
| * common/messaging: Use the jenkins hash in ctdb_messageVolker Lendecke2013-04-051-1/+3
| | | | | | | | | | | | This give a better hash distribution (This used to be ctdb commit f7f8bde2376f8180a0dca6d7b8d7d2a4a12f4bd8)
| * common/messaging: use tdb_parse_record in message_list_db_fetchVolker Lendecke2013-04-051-11/+17
| | | | | | | | | | | | This avoids malloc/free in a hot code path. (This used to be ctdb commit c137531fae8f7f6392746ce1b9ac6f219775fc29)
| * common/messaging: Abstract db related operations inside db functionsAmitay Isaacs2013-04-051-57/+39
| | | | | | | | | | | | | | | | | | This simplifies the use of message indexdb API and abstracts tdb related code inside the API. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit bf7296ce9b98563bcb8426cd035dbeab6d884f59)
| * common/messaging: Don't forget to free the result returned by tdb_fetch()Amitay Isaacs2013-04-051-0/+6
| | | | | | | | | | | | | | | | This fixes a memory leak in the messaging code. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 20be1f991dd75c2333c9ec9db226432a819f57ba)
| * common/messaging: Free message list header if all message handlers are freedAmitay Isaacs2013-04-051-3/+3
| | | | | | | | | | | | | | | | | | | | This makes sure that even if the srvids are not deregistered, the header structure is freed when the last message handler has been freed as a result of client going away. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 4e1ec7412866f2d31c41de1bec0fbf788c03051b)
| * build: Fix for tevent autoconf checkSumit Bose2013-03-271-1/+1
| | | | | | | | | | | | The list of include files is the 4th argument of AC_CHECK_DECLS. (This used to be ctdb commit 85b777196289646ca37e06ebbf1f7a684d0aabc5)
| * util: Add hex_decode_talloc() to decode hex string into a binary blobAmitay Isaacs2013-03-252-0/+17
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 307416afda707b687f5e89e8438e45c154a4c806)
| * logging: Do not ignore stdout/stderr from the exec'd childrenAmitay Isaacs2013-03-251-5/+0
| | | | | | | | | | | | | | | | | | | | To log debugging information from child processes that are started with vfork and exec, do not set close_on_exec on STDOUT and STDERR for that process. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 08c53ee609b80f87450a7a1d7dd24fbcdf5ab7bc)
| * server:persistent: fix a debug message (copy'n'paste error)Michael Adam2013-03-121-2/+3
| | | | | | | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit 87c89b7c2a14e2ee79a3efc7e8125842bc04bf23)
| * fix a typoVolker Lendecke2013-03-121-1/+1
| | | | | | | | | | | | Reviewed-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit 98abd344342a011a8599411deae79f94abc09541)
| * common/io: For scheduling immediate events use tevent_schedule_immediateAmitay Isaacs2013-03-061-11/+15
| | | | | | | | | | | | | | | | | | | | tevent_schedule_immediate() is much more efficient at handling events that need to be processed immediately rather than creating timed events with timeval_zero(). Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 11734be353a1e246163eda631d35dfe55d1d6fb1)
| * ctdbd: Add an index db for message list for faster searchesAmitay Isaacs2013-03-063-23/+203
| | | | | | | | | | | | | | | | | | | | | | When CTDB is busy with lots of smbd, CTDB was spending too much time in daemon_check_srvids() which searches a list of srvids in the registered message handlers. Using a hash based index significantly improves the performance of search in a linked list. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 3e09f25d419635f6dd679b48fa65370f7860be7d)
| * 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)
| * 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)