summaryrefslogtreecommitdiff
path: root/ctdb
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-utils: Fix CID 1125558 (Unchecked return value from library)Martin Schwenke2019-06-051-1/+7
| | | | | | | | 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): Wed Jun 5 12:09:56 UTC 2019 on sn-devel-184
* ctdb-daemon: Attempt to silence CID 1357985 (Unchecked return value)Martin Schwenke2019-06-051-1/+1
| | | | | | | | | | Yes, the other callers check the return value of ctdb_lockdb_mark(). However, this is called in a void function and ctdb_lockdb_mark() has already printed any error message. All we can do is explicitly ignore the return value. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-cluster: CID 1435726: NULL pointer dereferenceMartin Schwenke2019-06-051-1/+12
| | | | | | | Also found by csbuild. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-ipalloc: Fix warning about unused value assigned to srcimblMartin Schwenke2019-06-051-2/+3
| | | | | | | | To make this much clearer, move the declaration into the scope where it is used. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-ipalloc: Avoid -1 as a PNN, use CTDB_UNKNOWN_PNN insteadMartin Schwenke2019-06-054-26/+27
| | | | | | | This fixes warnings about signed versus unsigned comparisons. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-ipalloc: Fix signed/unsigned comparisons by declaring as unsignedMartin Schwenke2019-06-055-18/+20
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Avoid potentially uninitialised dataMartin Schwenke2019-06-051-2/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-utils: Avoid warning about unused valueMartin Schwenke2019-06-051-0/+4
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recovery: Fix signed/unsigned comparisons by declaring as unsignedMartin Schwenke2019-06-051-15/+16
| | | | | | | | Simple cases where variables and function parameters need to be declared as an unsigned type instead of an int. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recovery: Avoid -1 as a PNN, use CTDB_UNKNOWN_PNN insteadMartin Schwenke2019-06-051-1/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recovery: Fix signed/unsigned comparison by castingMartin Schwenke2019-06-051-1/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recovery: Fix signed/unsigned comparisons by declaring as unsignedMartin Schwenke2019-06-052-21/+31
| | | | | | | | Simple cases where variables need to be declared as an unsigned type instead of an int. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Fix signed/unsigned comparison by using constantMartin Schwenke2019-06-051-1/+1
| | | | | | | Variable reqid is unsigned, so don't compare with -1. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-client: Fix potentially uninitialised dataMartin Schwenke2019-06-051-2/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-client: Fix signed/unsigned comparisons by declaring as unsignedMartin Schwenke2019-06-054-10/+11
| | | | | | | | Simple cases where a variables and function parameters need to be declared as an unsigned type instead of an int. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Avoid unused value warningMartin Schwenke2019-06-051-1/+1
| | | | | | | | The incremented value of argc is indeed never used. Leave it as a comment to warn anyone cutting and pasting the code. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Avoid warning for potentially uninitialised pointersMartin Schwenke2019-06-051-2/+2
| | | | | | | s_list generates a warning, but initialise them both. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Use #ifdef to avoid TEST_RB_TREE not definedMartin Schwenke2019-06-051-2/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Fix signed/unsigned comparisons by castingMartin Schwenke2019-06-052-8/+8
| | | | | | | | In one case, given triviality of change, add missing braces and fix whitespace. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Fix signed/unsigned comparisons by declaring as unsignedMartin Schwenke2019-06-053-8/+10
| | | | | | | | | Simple cases where a variable (usually a loop variable) needs to be declared as an unsigned type (unsigned int or size_t) instead of an int. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Fix potentially uninitialised dataMartin Schwenke2019-06-051-1/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Fix signed/unsigned conversion by declaring as size_tMartin Schwenke2019-06-051-4/+7
| | | | | | | | | | All the top-level callers pass size_t. Drop the ternary operator. The value of hsize is always positive because it is unsigned. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Fix signed/unsigned comparison by declaring as intMartin Schwenke2019-06-051-1/+1
| | | | | | | | | There's no point using unsigned here. tdb_traverse() returns an int for the number of records traversed and the number of empty records can't exceed this value. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Fix signed/unsigned comparison by declaring as unsignedMartin Schwenke2019-06-051-1/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Fix signed/unsigned comparisons by castingMartin Schwenke2019-06-051-7/+8
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Fix signed/unsigned comparisons by declaring extra variableMartin Schwenke2019-06-051-8/+9
| | | | | | | | This needs an extra variable because variable i has been used in both signed and unsigned contexts. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Fix signed/unsigned comparisons by declaring as unsignedMartin Schwenke2019-06-051-47/+62
| | | | | | | | | These are the simple cases where a variable (usually a loop variable) needs to be declared as an unsigned type (usually unsigned int or size_t) instead of an int. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Fix tcp_tw_recycle existence checkRafael David Tinoco via samba-technical2019-06-041-2/+2
| | | | | | | | | | | | | | | net.ipv4.tcp_tw_recycle has been removed from Linux 4.12 but, still, makes sense to check its existence. Unfortunately, current check does not test for the procfs file existence. This commit fixes the issue. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13984 Signed-off-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Jun 4 23:31:24 UTC 2019 on sn-devel-184
* ctdb:takeover: add better debugging when a client connects to a non public ā†µStefan Metzmacher2019-06-041-19/+39
| | | | | | | address Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb:protocol_util: remove 'const' from allocated stringsStefan Metzmacher2019-06-042-11/+12
| | | | | | | | The caller should be able to call TALLOC_FREE() on the returned strings. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb/server: cppcheck: fix shiftTooManyBitsSigned errorNoel Power2019-06-041-1/+1
| | | | | | | | | Fixes ctdb/server/ipalloc_lcp2.c:61: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck] Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org>
* ctdb:tests: Add missing va_end() in ctdb_set_error()Andreas Schneider2019-05-241-0/+1
| | | | | | | Found by csbuild. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@samba.org>
* ctdb: Make TDB_SEQNUM work synchronously with ctdbVolker Lendecke2019-05-242-39/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Old war story completely from memory, I could not find the commit that introduced TDB_SEQNUM so far...: Back in the days when ctdb was initially developed, TDB_SEQNUM's only user was the notify.tdb that held one huge record for all notify records. With that use case in mind it made perfect sense to keep the SEQNUM stable locally, sacrificing precision. By now notify.tdb is long gone, an the only user of TDB_SEQNUM right now is brlock.tdb, which contains special case code for the imprecise ctdb implementation of TDB_SEQNUM. With this commit, that special code can go: The TDB_SEQNUM will also increment when just the DMASTER header field changes, indicating to smbd that someone else might have changed the record. This will of course increase the SEQNUM frequency, but it should not increase the load on ctdb: If you look at the brlock.c workaround, it just does not do the caching that is possible with precise TDB_SEQNUMs working. How did I get here? I want to move brl_num_read_oplocks() from brlock.tdb into locking.tdb, and for that I need precise TDB_SEQNUMs for locking.tdb. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri May 24 00:42:17 UTC 2019 on sn-devel-184
* ctdb: Remove unused ctdb_ltdb_fetch_with_header()Volker Lendecke2019-05-232-39/+0
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu May 23 18:08:36 UTC 2019 on sn-devel-184
* ctdb-common: Fix memory leak in run_procAmitay Isaacs2019-05-141-2/+5
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13943 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): Tue May 14 08:59:03 UTC 2019 on sn-devel-184
* ctdb-common: Fix memory leakMartin Schwenke2019-05-141-1/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13943 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recoverd: Fix memory leakMartin Schwenke2019-05-141-1/+1
| | | | | | | | | | state is always freed before exiting this function, so allocate fde off it instead of long-lived ctdb context. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13943 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Fix logic error in simple ctdb reloadips testMartin Schwenke2019-05-141-17/+20
| | | | | | | | | | | | | | | There is a chance that restoring IP addresses to the test node will result in different IP addresses being assigned to that node. Removing a single IP address may then fail (or be a no-op) if it is done after the restore. So, swap the single IP address removal to happen first, then restore, then remove all IP addresses. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Make ctdb reloadips tests more reliableMartin Schwenke2019-05-142-7/+61
| | | | | | | | | | | | ctdb reloadips will fail if it can't disable takover runs. The most likely reason for this is that there is already a takeover run in progress. We can't predict when this will happen, so retry if this occurs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Capture output in $out on failure as wellMartin Schwenke2019-05-141-3/+5
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Remove old socket wrapper state directory during setupMartin Schwenke2019-05-131-0/+1
| | | | | | | | | | | | | Otherwise, when looping tests for a long time, nodes are unable to connect to each other. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924 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 May 13 08:42:44 UTC 2019 on sn-devel-184
* ctdb-tests: Actually restart if cluster doesn't become healthyMartin Schwenke2019-05-131-0/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add dump-logs command for local daemonsMartin Schwenke2019-05-131-0/+27
| | | | | | | Dump a single merged log to stdout. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add reqid wrapping testAmitay Isaacs2019-05-131-0/+16
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13930 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Never use 0 as a client IDMartin Schwenke2019-05-131-1/+47
| | | | | | | | | | | ctdb_control_db_attach() and ctdb_control_db_detach() assume that any control with client ID 0 comes from another daemon and treat it specially. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13930 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb/build: fix ctdb_mutex_ceph_rados_helper buildsDavid Disseldorp2019-05-091-1/+4
| | | | | | | | | | | | 2b5dbb352553699afce62dca4964eb0bd64477f8 fixed builds with an explicit --with-libcephfs but broke builds against system Ceph libraries. This change handles both cases. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Thu May 9 04:24:56 UTC 2019 on sn-devel-184
* ctdb:common: Do not print NULL if we don't get a sockpathAndreas Schneider2019-05-081-1/+1
| | | | | | | | | sock_socket_start_recv() might not fill sockpath if we return early. Found by GCC 9. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ctdb: Fix format in db_hash_testAndreas Schneider2019-05-071-1/+1
| | | | | | | | | error: ā€˜%04dā€™ directive writing between 4 and 11 bytes into a region of size 5 [-Werror=format-overflow=] sprintf(key, "key%04d", i); Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* ctdb-tests: Don't clean up test var directory in autotest targetMartin Schwenke2019-05-071-1/+1
| | | | | | | | | | | | | | | | If the directory is always cleaned up then it is not possible to look at daemon logs to debug test failures. This target is only really used by autobuild.py, which (optionally) cleans up the parent directory anyway. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924 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 May 7 06:56:01 UTC 2019 on sn-devel-184
* ctdb-tests: Fix usage messageMartin Schwenke2019-05-071-1/+1
| | | | | | | | | | | Since commit 0e9ead8f28fced3ebfa888786a1dc5bb59e734a3 daemons have been shut down after each test, so this option no longer has anything to do with killing daemons. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>