summaryrefslogtreecommitdiff
path: root/ctdb
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-recovery: Log messages at various debug levelsAmitay Isaacs2017-06-131-135/+146
| | | | | | | | | | This avoids spamming the logs during recovery at NOTICE level. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Tue Jun 13 13:22:09 CEST 2017 on sn-devel-144
* ctdb-scripts: Compact server-end TCP connection killing outputMartin Schwenke2017-06-137-52/+141
| | | | | | | | | | | | | | | | | | | | When thousands of connections are being killed the logs are flooded with information about connections that should be killed. When some connections are not killed then the number not killed is printed. This is the wrong way around! When debugging "fail-back" problems, it is important to know details of connections that were *not* killed. It is almost never important to know the full list of all connections that were *supposed* to be killed. Instead, print a summary showing how many connections of the total were killed. If any were not killed then print a list of remaining connections. Update unit tests: infrastructure for fake TCP connections, existing, test cases, add new test cases. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Log a count of dropped messages with non-blocking loggingMartin Schwenke2017-06-131-5/+53
| | | | | | | | | | | The non-blocking logging variants can currently silently drop messages when the socket queue fills. In this case, count the number of dropped messages and attempt to log a message about dropped log messages when the next message is logged. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add more NFS eventscript tests for call-out failuresMartin Schwenke2017-06-1313-0/+156
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12837 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: NFS call-out failures should cause event failureMartin Schwenke2017-06-131-4/+4
| | | | | | | | | | Failures in startup/shutdown/releaseip/takeip are currently incorrectly ignored. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12837 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-client: Document ctdb client APIAmitay Isaacs2017-06-071-40/+857
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Wed Jun 7 20:19:06 CEST 2017 on sn-devel-144
* ctdb-client: Move eventd API to a separate headerAmitay Isaacs2017-06-074-68/+94
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Move sync API to a separate headerAmitay Isaacs2017-06-078-501/+533
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Move ctdb_ctrl_modflags() to ctdb toolAmitay Isaacs2017-06-073-39/+34
| | | | | | | This function is only required by the tool. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Add async api for detaching a databaseAmitay Isaacs2017-06-073-13/+160
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Create sync wrappers for managing message handlersAmitay Isaacs2017-06-071-11/+33
| | | | | | | | This wraps the entire async computation for setting and removing message handlers instead of calling multiple sync calls. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tools: Use traverse api to re-implement ctdb catdb commandAmitay Isaacs2017-06-071-82/+7
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Refactor cluster-wide database traverse apiAmitay Isaacs2017-06-072-0/+263
| | | | | | | | This implements the async version of the traverse code in the ctdb tool for catdb command. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-protocol: Allocate SRVID range for ctdb clientAmitay Isaacs2017-06-071-1/+7
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Rename ctdb_db_travese to ctdb_db_traverse_localAmitay Isaacs2017-06-073-16/+18
| | | | | | | This function only traverses the database on local node. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* Log the actual error returned when creating a pipe for client logging in ↵Richard Sharpe2017-06-071-1/+2
| | | | | | | | | | CTDB fails. Helps with debugging issues. Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jun 7 09:22:29 CEST 2017 on sn-devel-144
* ctdb-common: Fix crash in logging initialisationMartin Schwenke2017-06-011-0/+1
| | | | | | | | | | | | | | | Setting CTDB_LOGGING to syslog:nonblocking or syslog:udp will cause ctdbd to crash at startup due to NULL pointer dereference. Refactoring in commit c9124a001f5abf7bb577a8f5341da4cc7411ed22 introduced this regression. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12814 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): Thu Jun 1 15:26:19 CEST 2017 on sn-devel-144
* ctdb-tools: Always exit with positive return valueAmitay Isaacs2017-05-301-1/+2
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Tue May 30 08:05:56 CEST 2017 on sn-devel-144
* ctdb-eventd: Avoid passing NULL pointer to printf( %s )Amitay Isaacs2017-05-301-1/+2
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-eventd: Use run_event abstractionAmitay Isaacs2017-05-301-703/+127
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Add run_event abstractionAmitay Isaacs2017-05-305-2/+1286
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Update run_proc api to re-assign stdinAmitay Isaacs2017-05-305-20/+52
| | | | | | | This allows to pass data to a child process via stdin. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Add some extra tests for "ctdb nodestatus"Martin Schwenke2017-05-264-0/+129
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12802 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Fri May 26 05:24:34 CEST 2017 on sn-devel-144
* ctdb-tools: "ctdb nodestatus" should only display header for "all"Martin Schwenke2017-05-261-8/+16
| | | | | | | | | | | | | The "Number of nodes:" header should only be displayed when "all" is specified. This is how the command behaved in Samba <= 4.4. Printing the number of nodes is not helpful and is rather confusing in the default case where only the status of the current node is printed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12802 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Stop "ctdb nodestatus" from always showing all nodesMartin Schwenke2017-05-261-5/+0
| | | | | | | | | | | | Exit code should only reflect current or specified nodes too. Drop an unwanted call to get_nodemap() that overwrites the previously calculated node map. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12802 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Add AllowMixedVersions tunableAmitay Isaacs2017-05-245-0/+38
| | | | | | | | | | This allows to mix CTDB major versions in a single cluster. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Wed May 24 21:06:28 CEST 2017 on sn-devel-144
* ctdb-daemon: Do not allow mixed ctdb versions in a clusterAmitay Isaacs2017-05-245-0/+69
| | | | | | | | Extend CTDB_REQ_KEEPALIVE packet to include version and uptime. If CTDB versions do not match shutdown ctdb. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-keepalive: Move ctdb_send_keepalive() to ctdb_keepalive.cAmitay Isaacs2017-05-243-30/+27
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-packaging: Remove mkversion.sh scriptAmitay Isaacs2017-05-241-84/+0
| | | | | | | It's not used any more as the version headers are generated from waf. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-build: Simplify generation of version header filesAmitay Isaacs2017-05-241-29/+21
| | | | | | | Generate version headers from waf instead of separate shell script. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-readonly: Avoid a tight loop waiting for revoke to completeAmitay Isaacs2017-05-241-33/+58
| | | | | | | | | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12697 During revoking readonly delegations, if one of the nodes disappears, then there is no point re-trying revoking readonly delegation immedately. The database needs to be recovered before the revoke operation can succeed. However, if the revoke is successful, then all the write requests need to be processed immediately before the read-only requests. This avoids starving write requests, in case there are read-only requests coming from other nodes. In deferred_call_destructor, the result of revoke is not available and deferred calls cannot be correctly ordered. To correctly order the deferred calls, process them in revokechild_destructor where the result of revoke is known. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* Revert "ctdb-readonly: Avoid a tight loop waiting for revoke to complete"Amitay Isaacs2017-05-241-5/+3
| | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12697 This reverts commit ad758cb869ac83534993caa212abc9fe9905ec68. This is an incomplete fix and introduces a regression. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Use tighter pattern for matching expected outputAmitay Isaacs2017-05-151-1/+1
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12792 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Mon May 15 08:08:10 CEST 2017 on sn-devel-144
* ctdb-tests: Explicitly search for the specific log entryAmitay Isaacs2017-05-151-1/+1
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12792 ... instead of expecting the last line to be the matching log entry. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb: Print key as hex string instead of just the hash in hot record messageChristof Schmitt2017-05-081-3/+8
| | | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-logging: Initialize DEBUGLEVEL before changing the valueAmitay Isaacs2017-05-081-0/+2
| | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12770 DEBUGLEVEL is defined as a const array reference at compile time. debug_init() converts that to an allocated array reference at run time. Since debug_init() is a static function, initialize DEBUGLEVEL via setup_logging(). 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 May 8 00:12:25 CEST 2017 on sn-devel-144
* ctdb-docs: Fix documentation of -n option to ctdb toolAmitay Isaacs2017-04-061-2/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12733 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: David Disseldorp <ddiss@samba.org>
* ctdb-daemon: Add tracking of migration recordsAmitay Isaacs2017-04-053-1/+86
| | | | | | | | | | | Instead of using hopcount as a metric for hot records, use the number of migrations per second as a metric. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Wed Apr 5 08:35:45 CEST 2017 on sn-devel-144
* ctdb-daemon: For hot records, use count instead of hopcountAmitay Isaacs2017-04-051-9/+11
| | | | | | | This avoids tying hopcounts to hot records. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Add hash_count abstractionAmitay Isaacs2017-04-055-1/+455
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Add traverse_update function to db_hash abstractionAmitay Isaacs2017-04-052-2/+44
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tools: Avoid deferencing argv[0] if argc == 0Amitay Isaacs2017-03-291-5/+8
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12723 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Wed Mar 29 11:07:18 CEST 2017 on sn-devel-144
* ctdb-tests: Catch cases where mktemp fails due to missing TMPDIRMartin Schwenke2017-03-201-2/+2
| | | | | | | | | | | | TMPDIR sometimes goes missing during autobuild. When that happens the error messages produced by CTDB tests are not very helpful. This should make it clear. 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): Mon Mar 20 08:53:02 CET 2017 on sn-devel-144
* ctdb-readonly: Avoid a tight loop waiting for revoke to completeAmitay Isaacs2017-03-171-3/+5
| | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12697 During revoking readonly delegations, if one of the nodes disappears, then there is no point re-trying revoking readonly delegation. The database needs to be recovered before the revoke operation can succeed. So retry only after a grace period. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Fri Mar 17 14:05:57 CET 2017 on sn-devel-144
* waf: disable-python - fix ctdb configurationIan Stakenvicius2017-03-101-2/+2
| | | | | | | | | | | | | | When ctdb is built in standalone mode, it turned off the python requirement for submodules by setting Options.options.disable_python to True before checking for its own (non-optional) python support. Ad ctdb does not need python for itself or any of the submodules it is built against, the safest solution seems to be to allow the python and python-headers checks to not find python. Signed-off-by: Ian Stakenvicius <axs@gentoo.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* ctdb-build: Fix RPM buildMartin Schwenke2017-02-271-1/+2
| | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12595 It doesn't look like recursion works for appending scripting commands. Unroll the recursion instead. 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): Mon Feb 27 03:09:27 CET 2017 on sn-devel-144
* ctdb-build: Add WAFLOCK magic to manpages targetMartin Schwenke2017-02-261-1/+2
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12595 Without this a top-level "make dist" fails to build the CTDB manpages. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-takeover: Don't release IPs from nodes where they are not knownMartin Schwenke2017-02-242-4/+10
| | | | | | | | | | | | This avoids confusing log messages like: ctdbd[21635]: releaseip called for an ip '10.1.1.1' that is not a public address Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Fri Feb 24 11:50:36 CET 2017 on sn-devel-144
* ctdb-ipalloc: Add per-IP known_on bitmapMartin Schwenke2017-02-242-0/+23
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-takeover: Fetch public IP addresses from all connected nodesMartin Schwenke2017-02-241-1/+1
| | | | | | | | | Redundant releases will be sent to all connected nodes anyway, so this is no worse. This will facilitate an improvement to avoid sending releases to nodes with no known IPs. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>