summaryrefslogtreecommitdiffstats
path: root/ctdb/include
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-common: New function ctdb_set_helper()Martin Schwenke2015-03-101-0/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-recoverd: Simplify ctdb_recovery_lock()Martin Schwenke2015-02-131-1/+1
| | | | | | | | | | | | | | Have it just silently take or fail to take the lock, except on an unexpected failure (where it should log an error). This means that when it is called we need to keep the old behaviour and explicitly release the lock. In do_recovery() the lock is released and a message is printed before attempting to take the lock. In the daemon sanity check the lock must be released in the error path if it is actually taken. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recoverd: New function ctdb_recovery_unlock()Martin Schwenke2015-02-131-0/+1
| | | | | | | | Unlock the recovery lock file. This way knowledge of the file descriptor isn't sprinkled throughout the code. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recoverd: New function ctdb_recovery_have_lock()Martin Schwenke2015-02-131-0/+1
| | | | | | | True if this recovery daemon holds the lock. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb: ctdb_protocol.h references struct sockaddrVolker Lendecke2014-12-071-0/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ctdb-vacuum: Track time for vacuuming in database statisticsAmitay Isaacs2014-12-051-0/+3
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-includes: Reorder includes.h more logicallyMartin Schwenke2014-10-311-7/+8
| | | | | | | | | | | | For now replace.h needs to be before tdb.h, since tdb.h needs stdbool.h. This is fixed upstream but not yet in various packaged versions. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Fri Oct 31 03:46:40 CET 2014 on sn-devel-104
* ctdb-includes: Remove unused idtree.hMartin Schwenke2014-10-311-11/+0
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-includes: Clean up includes.hMartin Schwenke2014-10-311-21/+0
| | | | | | | | | | Remove unused #defines. CTDB doesn't use these. _PUBLIC_ is defined in replace.h anyway. Remove unnecessary #includes. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb: Rename CTDB_VERSION to CTDB_PROTOCOLAmitay Isaacs2014-10-281-1/+1
| | | | | | | CTDB_VERSION really is the ctdb protocol version. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb: Rename ctdb socket variable from CTDB_PATH to CTDB_SOCKETAmitay Isaacs2014-10-281-2/+2
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-logging: New option CTDB_LOGGING, remove CTDB_LOGFILE, CTDB_SYSLOGMartin Schwenke2014-10-282-4/+7
| | | | | | | | | | | | Remove --logfile and --syslog daemon options and replace with --logging. Modularise and clean up logging initialisation code. The initialisation API includes an app_name argument that is currently unused - this will be used in extensions to the syslog backend. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Replace logd code with a basic syslog(3) implementationMartin Schwenke2014-10-281-4/+2
| | | | | | | | | | | | | | It is much simpler for most cases to have a syslog backend that doesn't need a separate CTDB-specific logging daemon. This loses the lossy, non-blocking mode provided by logd. However, a corresponding feature with a completely different implemention (not requiring an extra daemon) will be re-added into the syslog backend. In an ideal world the new implementation would be added first but unfortunately that is hard to do because the logd code is hooked in at more than one place. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Separate out syslog and file logging backendsMartin Schwenke2014-10-282-8/+4
| | | | | | | | | This makes the code cleaner and allows the syslog backend to be easily modified without affecting other code. Also do some extra clean-up, including whitespace fixups. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Rework debug level parsingMartin Schwenke2014-10-282-9/+8
| | | | | | | | | | | | | Put declarations into ctdb_logging.h, factor out some common code, clean up #includes. Remove the check so see if the 1st character of the debug level is '-'. This is wrong, since it is trying to check for a negative numeric debug level (which is no longer supported) and would need to be handled in the else anyway. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Remove ctdb element from struct ctdb_log_stateMartin Schwenke2014-10-281-1/+1
| | | | | | | | This is set but otherwise not used. This allows the 1st argument to ctdb_set_logfile() to be generalised to a TALLOC_CTX. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Remove log member from struct ctdb_contextMartin Schwenke2014-10-281-1/+0
| | | | | | | | | This is only used by logging code and there is already a file-level variable for this. struct ctdb_context already contains too many things. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Remove debug levels DEBUG_ALERT and DEBUG_CRITMartin Schwenke2014-10-281-2/+4
| | | | | | | | | | | | | | Internally map them to DEBUG_ERR to limit code churn. This reduces the unwieldy number of debug levels used by CTDB. ALERT and CRIT aren't of much use as separate errors, since everything from ERR up should always be logged. In future just ERR can be used. This also improves compatibility with Samba's debug.c system priority mapping. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Remove DEBUG_EMERGMartin Schwenke2014-10-281-1/+0
| | | | | | | | | | It isn't used and shouldn't be. CTDB can't make the system unusable. Update associated test to ensure that EMERG isn't attempted. Actually test all remaining debug levels and modernise the test a bit. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-build: Fix handling of public headersMartin Schwenke2014-10-061-0/+6
| | | | | | | | | | | Add the header munging, add/package ctdb_version.h, create directory include/public. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Oct 6 14:56:07 CEST 2014 on sn-devel-104
* ctdb-build: Change from ctdb-util to samba-utilMartin Schwenke2014-10-061-11/+1
| | | | | | | | | | | | | | | | | | Remove local lib/util and lib/tdb-wrap. Update wscript, packaging and includes.h. The only potentially surprising thing here is a fake samba-util subsystem that just depends on samba-util-core. As explained in a comment: When a combined build is implemented, CTDB will wanted to build against samba-util rather than samba-util-core. Similarly, other Samba subsystems expect samba-util. So, for a standalone build, just define a fake samba-util subsystem that pulls in samba-util-core. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-logging: Update to use Samba style debug.h/debug.cMartin Schwenke2014-10-061-6/+0
| | | | | | | | | | | | | | | | | | | | | Samba's debug subsystem has changed a lot, so CTDB's logging needs to be rewritten to be compatible. The new debug.h/debug.c can't just be pulled in because it has some extra dependencies into Samba's lib/util. For now, to support the smallest possible patch, implement a minimal subset of Samba's debug.[ch] that just supports the DEBUG_CALLBACK logtype. Define a callback for each logging method. Check later to see if debug_extra (or similar) can somehow be implemented using debug classes. The timestamp on CTDB CLI tool and test program DEBUG() output goes away, so update the unit test code to cope. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-logging: Change LogLevel to DEBUGLEVELMartin Schwenke2014-10-061-4/+4
| | | | | | | For compatibility with current Samba debug.[ch]. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-logging: Remove log ringbufferMartin Schwenke2014-10-063-15/+3
| | | | | | | | | | | As far as we know, nobody uses this and it just complicates the logging subsystem. Remove all ringbuffer code and documentation. Update the local daemons startup code correspondingly. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-logging: Add forward declaration of debug_levelMartin Schwenke2014-09-231-0/+1
| | | | | | | | | | | | | | | Warnings are currently produced when compiling Samba and ctdb_private.h is included. A forward enum declaration avoids the warning. This is a temporary measure. The log ringbuffer should be removed soon. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Tue Sep 23 10:31:50 CEST 2014 on sn-devel-104
* ctdb-daemon: Make sure ctdb runs with real-time priorityAmitay Isaacs2014-09-121-1/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-includes: Remove some unnecessary declarationsMartin Schwenke2014-09-111-3/+0
| | | | | | | | To accommodate removing file_lines_load() from here, drop the #ifdef around the declaration in util.h. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Move variable debug_extra from debug.*Martin Schwenke2014-09-101-0/+1
| | | | | | | | debug_extra is CTDB-specific. Moving it will help with the transitions to Samba's updated debug.[ch]. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Factor out ctdb_logging.h from includes.hMartin Schwenke2014-09-102-17/+42
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Move definition of timeval_delta() to tools/ctdb.cMartin Schwenke2014-09-101-1/+0
| | | | | | | | This function is only used in this file. Samba's lib/util doesn't have timeval_delta(), so staging a clean transition. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-util: Add extra max_size argument to file_lines_load()Martin Schwenke2014-09-101-1/+1
| | | | | | | | | This is part of a migration to Samba's lib/util. CTDB always passes 0 (i.e. no max_size) so use a simple assert() to enforce this, rather than changing a lot of code that will be discarded anyway. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-util: Remove declaration of non-existent ctdb_fault_setup()Martin Schwenke2014-09-101-2/+0
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Move hex_decode_talloc() to the lock helperMartin Schwenke2014-09-101-1/+0
| | | | | | | | | | This is the only place it is used. After migrating to Samba's lib/util, the lock helper can be changed to use strhex_to_data_blob(). Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Move some inline declarations to header fileMartin Schwenke2014-09-101-0/+2
| | | | | | | | To avoid warnings when using --enable-developer, which uses -Wmissing-prototypes. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-util: Remove util/strlist.c and references to str_util_*()Martin Schwenke2014-09-101-1/+0
| | | | | | | They're not used in CTDB. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Defer all calls when processing dmaster packetsAmitay Isaacs2014-09-051-0/+1
| | | | | | | | | | | When CTDB receives DMASTER_REQUEST or DMASTER_REPLY packet, the specified record needs to be updated as soon as possible to avoid inconsistent dmaster information between nodes. During this time, queue up all calls for that record and process them only after dmaster request/reply has been processed. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Refactor code to convert TDB_DATA key to aligned uint32 arrayAmitay Isaacs2014-09-051-0/+2
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-include: Remove declaration of non-existent functionAmitay Isaacs2014-09-051-1/+0
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-locking: Remove unused function ctdb_free_lock_request_contextAmitay Isaacs2014-09-051-2/+0
| | | | | | | | | There is no need for a special function to free lock request and corresponding lock context. Freeing lock request will free lock context also. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-locking: Talloc lock request from client specified contextAmitay Isaacs2014-09-051-4/+8
| | | | | | | | | This makes sure that when the client context is destroyed, the lock request goes away. If the lock requests is already scheduled, then the lock child process will be terminated. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Copy functions sys_read() and sys_write() from source3Martin Schwenke2014-08-211-0/+3
| | | | | | | | | We really should extricate these from source3 and into some common code. However, just copy them for now to help get rid of a lot of warnings. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-locking: Add per database queues for pending and active lock requestsAmitay Isaacs2014-08-041-0/+2
| | | | | | | | | | | | | | | | This avoids traversing a single pending queue which is quite expensive when there are lots of pending lock requests. This seems to happen quite a lot on a loaded cluster for notify_index.tdb. Adding per database queues avoids the need to traverse pending queue for that database if there are already the maximum number of active lock requests. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Aug 4 20:23:45 CEST 2014 on sn-devel-104
* ctdb-locking: Remove unused variable lock_num_pendingAmitay Isaacs2014-08-041-1/+0
| | | | | | | | The number of pending locks displayed in ctdb statistics are stored in ctdb_statistics structure and not ctdb_context. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-locking: Add new tunable LockProcessesPerDBAmitay Isaacs2014-08-041-0/+1
| | | | | | | | This allows to change the maximum number of lock processes that can be active. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-daemon: Support per-node robust mutex featureAmitay Isaacs2014-07-091-0/+1
| | | | | | | | | | | | | | | | To enable TDB mutex support, set tunable TDBMutexEnabled=1. When databases are attached for the first time, attach flags must include TDB_MUTEX_LOCKING and TDBMutexEnabled must set to enable mutex support. However, when CTDB attaches databases internally for recovery, it will enable mutex support if TDBMutexEnabled is set. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Wed Jul 9 06:45:17 CEST 2014 on sn-devel-104
* ctdb-daemon: Do not thaw databases if recovery is activeAmitay Isaacs2014-07-071-1/+2
| | | | | | | | This prevents ctdb tool from thawing databases prematurely in thaw/wipedb/restoredb commands if recovery is active. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Remove ctdbd_pid global variableMartin Schwenke2014-07-051-5/+0
| | | | | | | | | This duplicates ctdb->ctdbd_pid. Thanks to Sumit Bose <sbose@redhat.com> for the suggestion. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb:includes: add #ifdef guard for ZERO_STRUCTMichael Adam2014-06-201-0/+2
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb:includes: add #ifdef guards for _PUBLIC_, _NORETURN_, and _PURE_Michael Adam2014-06-201-0/+6
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-header: Protect against multiple includesAmitay Isaacs2014-06-202-0/+7
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>