summaryrefslogtreecommitdiff
path: root/ctdb
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-recovery: Use correct struct ban_node_state type for stateChristof Schmitt2023-05-031-2/+2
| | | | | | | | | | | | | | | If this codepath is hit, ctdb aborts with: ctdb/server/ctdb_recovery_helper.c:2687: Type mismatch: name[struct ban_node_state] expected[struct node_ban_state]") at ../../lib/talloc/talloc.c:505 Fix this by using the correct type. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed May 3 08:04:09 UTC 2023 on atb-devel-224
* ctdb:tool: Remove unnecessary strlen()Joseph Sutton2023-04-121-2/+1
| | | | Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
* ctdb: Fix code spellingAndreas Schneider2023-04-113-3/+3
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
* lib/util: Add "debug syslog format = always", which logs to stdout in syslog ↵Andrew Bartlett2023-04-061-1/+1
| | | | | | | style Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* ctdb:doc: Fix code spellingAndreas Schneider2023-04-043-11/+11
| | | | | | Best reviewed with: `git show --word-diff`. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ctdb:utils: Fix code spellingAndreas Schneider2023-03-242-4/+4
| | | | | | | | | | Best reviewed with: `git show --word-diff` Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Mar 24 07:57:37 UTC 2023 on atb-devel-224
* ctdb:utils: Remove trailing whitespaces in scsi_io.cAndreas Schneider2023-03-241-10/+10
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
* ctdb:tool: Fix code spellingAndreas Schneider2023-03-241-3/+3
| | | | | | Best reviewed with: `git show --word-diff` Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
* ctdb:tests: Fix code spellingAndreas Schneider2023-03-2416-21/+21
| | | | | | Best reviewed with: `git show --word-diff` Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
* ctdb:tcp: Fix code spellingAndreas Schneider2023-03-241-1/+1
| | | | | | Best reviewed with: `git show --word-diff` Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
* ctdb:server: Fix code spellingAndreas Schneider2023-03-2412-62/+62
| | | | | | Best reviewed with: `git show --word-diff` Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
* ctdb:server: Remove trailing whitespaces in ctdb_server.cAndreas Schneider2023-03-241-17/+17
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
* ctdb:server: Remove trailing whitespaces in ctdb_recover.cAndreas Schneider2023-03-241-15/+15
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
* ctdb:include: Fix code spellingAndreas Schneider2023-03-241-1/+1
| | | | | | Best reviewed with: `git show --word-diff` Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
* ctdb:include: Remove trailing whitespaces in ctdb_protocol.hAndreas Schneider2023-03-241-2/+2
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
* ctdb:common: Fix code spellingAndreas Schneider2023-03-2410-11/+11
| | | | | | Best reviewed with: `git show --word-diff` Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
* ctdb:client: Fix code spellingAndreas Schneider2023-03-241-2/+2
| | | | | | Best reviewed with: `git show --word-diff` Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
* ctdb-scripts: Avoid using testparm to process its own outputMartin Schwenke2023-02-144-24/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When testparm processes the output of "testparm -v" (which includes default values) it appears to do global checks (or some other sort of initialisation logic) for all specified values. This includes a DNS lookup for the node's hostname, as a side-effect of a libldap ldap_set_option() call when processing "ldap debug level". If DNS servers are down then this can induce timeouts, possibly resulting in monitor timeouts. Avoid this by using sed to extract configuration values from the testparm cache file. This is already shown to work when retrieving share paths, where testparm is basically used as cat. Update the sed pattern to avoid matching empty values on the right-hand side of the equals ('=') - this avoids the default empty path value (and "smb ports" never has an empty value). Corresponding test changes: * 50.samba.monitor.111.sh no longer expects a failure from being unable to set smb ports, since testparm is no longer used in that code path. * smb ports needs to be set in fake smb.conf so it is in the default output and can be extracted using sed. * Although testparm --parameter-name is no longer used in 50.samba.script, update the stub implementation (in case it is ever used again) to extract from fake smb.conf, since "smb ports" is now set there. The change from $parameter to $param allows a long line to stay below 80 columns. Signed-off-by: Martin Schwenke <mschwenke@ddn.com> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Feb 14 08:43:53 UTC 2023 on atb-devel-224
* ctdb-scripts: Do not replace commas with spaces in "smb ports" listMartin Schwenke2023-02-142-3/+2
| | | | | | | | | The list changed back to space-separated in commit 93448f4be92d4e018aaf2f9705f0351360b2ed0f, so simplify the code a little. Signed-off-by: Martin Schwenke <mschwenke@ddn.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-scripts: Reformat script with "shfmt -w -p -i 0 -fn"Martin Schwenke2023-02-141-82/+83
| | | | | Signed-off-by: Martin Schwenke <mschwenke@ddn.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* Python: remove pydoctorRob van der Linde2023-02-021-3/+0
| | | | | | | | | | | | | | | | | | | Removes: * waf pydoctor * waf wafdocs * make pydoctor There is no "make wafdocs" it only appears to be in wscript. The reasoning being is these are broken and appear to not have been run for some time. Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Feb 2 21:15:54 UTC 2023 on atb-devel-224
* spelling fixes for 4.18 (errror implemenation proces Controler)Michael Tokarev2023-01-261-1/+1
| | | | | | | | | | | | | | One of changes is somewhat interesting, it is "tfork waiter proces" process title in tfork.c. I wonder why no one noticed this before. There's another similar process title in there, "tfork waiter process(%d)". Hopefully no one does grep for "proces$" (and there's no reason to). Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Rowland Penny <rpenny@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jan 26 20:46:11 UTC 2023 on atb-devel-224
* ctdb: Fix the build on FreeBSDVolker Lendecke2023-01-181-0/+1
| | | | | | | "basename" is define in libgen.h included from system/dir.h Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* ctdb: Fix a use-after-free in run_procVolker Lendecke2022-10-061-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you happen to talloc_free(run_ctx) before all the tevent_req's hanging off it, you run into the following: ==495196== Invalid read of size 8 ==495196== at 0x10D757: run_proc_state_destructor (run_proc.c:413) ==495196== by 0x488F736: _tc_free_internal (talloc.c:1158) ==495196== by 0x488FBDD: _talloc_free_internal (talloc.c:1248) ==495196== by 0x4890F41: _talloc_free (talloc.c:1792) ==495196== by 0x48538B1: tevent_req_received (tevent_req.c:293) ==495196== by 0x4853429: tevent_req_destructor (tevent_req.c:129) ==495196== by 0x488F736: _tc_free_internal (talloc.c:1158) ==495196== by 0x4890AF6: _tc_free_children_internal (talloc.c:1669) ==495196== by 0x488F967: _tc_free_internal (talloc.c:1184) ==495196== by 0x488FBDD: _talloc_free_internal (talloc.c:1248) ==495196== by 0x4890F41: _talloc_free (talloc.c:1792) ==495196== by 0x10DE62: main (run_proc_test.c:86) ==495196== Address 0x55b77f8 is 152 bytes inside a block of size 160 free'd ==495196== at 0x48399AB: free (vg_replace_malloc.c:538) ==495196== by 0x488FB25: _tc_free_internal (talloc.c:1222) ==495196== by 0x488FBDD: _talloc_free_internal (talloc.c:1248) ==495196== by 0x4890F41: _talloc_free (talloc.c:1792) ==495196== by 0x10D315: run_proc_context_destructor (run_proc.c:329) ==495196== by 0x488F736: _tc_free_internal (talloc.c:1158) ==495196== by 0x488FBDD: _talloc_free_internal (talloc.c:1248) ==495196== by 0x4890F41: _talloc_free (talloc.c:1792) ==495196== by 0x10DE62: main (run_proc_test.c:86) ==495196== Block was alloc'd at ==495196== at 0x483877F: malloc (vg_replace_malloc.c:307) ==495196== by 0x488EAD9: __talloc_with_prefix (talloc.c:783) ==495196== by 0x488EC73: __talloc (talloc.c:825) ==495196== by 0x488F0FC: _talloc_named_const (talloc.c:982) ==495196== by 0x48925B1: _talloc_zero (talloc.c:2421) ==495196== by 0x10C8F2: proc_new (run_proc.c:61) ==495196== by 0x10D4C9: run_proc_send (run_proc.c:381) ==495196== by 0x10DDF6: main (run_proc_test.c:79) This happens because run_proc_context_destructor() directly does a talloc_free() on the struct proc_context's and not the enclosing tevent_req's. run_proc_kill() makes sure that we don't follow proc->req, but it forgets the "state->proc", which is free()'ed, but later dereferenced in run_proc_state_destructor(). This is an attempt at a quick fix, I believe we should convert run_proc_context->plist into an array of tevent_req's, so that we can properly TALLOC_FREE() according to the "natural" hierarchy and not just pull an arbitrary thread out of that heap. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu Oct 6 15:10:20 UTC 2022 on sn-devel-184
* ctdb-scripts: Add debugging variable CTDB_KILLTCP_DEBUGLEVELMartin Schwenke2022-09-201-1/+7
| | | | | | | | | | | | | | To debug ctdb_killtcp failures, add CTDB_KILLTCP_DEBUGLEVEL=DEBUG to script.options. 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 20 11:42:16 UTC 2022 on sn-devel-184
* ctdb-common: Support IB in pcap-based captureMartin Schwenke2022-09-201-0/+2
| | | | | | | | | | | | Add simple support for IPoIB via DLT_LINUX_SLL and DLT_LINUX_SLL2. This seems to work, even when an IB interface is specified. If this is later found to be insufficient, support for DLT_IPOIB can be implemented. See https://www.tcpdump.org/linktypes.html for a starting point. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Support "any" interface for pcap-based captureMartin Schwenke2022-09-201-1/+49
| | | | | | | | | | | | | | | | | | | This uses Linux cooked capture link-layer headers. See: https://www.tcpdump.org/linktypes/LINKTYPE_LINUX_SLL.html https://www.tcpdump.org/linktypes/LINKTYPE_LINUX_SLL2.html The header type needs to be checked to ensure the protocol type (i.e. ether type, for the protocols we might be interested in) is meaningful. The size of the header needs to be known so it can be skipped, allowing the IP header to be found and parsed. It would be possible to define support for DLT_LINUX_SLL2 if it is missing. However, if a platform is missing support in the header file then it is almost certainly missing in the run-time library too. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Add packet type detection to pcap-based captureMartin Schwenke2022-09-201-18/+49
| | | | | | | | | | | | | | | | | | | | | | | | | The current code will almost certainly generate ENOMSG for non-ethernet packets, even for ethernet packets when the "any" interface is used. pcap_datalink(3PCAP) says: Do NOT assume that the packets for a given capture or ``savefile`` will have any given link-layer header type, such as DLT_EN10MB for Ethernet. For example, the "any" device on Linux will have a link-layer header type of DLT_LINUX_SLL or DLT_LINUX_SLL2 even if all devices on the sys‐ tem at the time the "any" device is opened have some other data link type, such as DLT_EN10MB for Ethernet. So, pcap_datalink() must be used. Detect pcap packet types that are supported (currently only ethernet) in the open code. There is no use continuing if the read code can't parse packets. The pattern of using switch statements supports future addition of other packet types. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Improve/add debugMartin Schwenke2022-09-201-6/+7
| | | | | | | | In particular, knowing the reason fetching the packet fails can help with debugging unsupported protocols in the pcap code. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Improve/add debugMartin Schwenke2022-09-201-2/+6
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Use pcap_get_selectable_fd()Martin Schwenke2022-09-201-1/+1
| | | | | | | | This is preferred because it will fail for devices that do not support epoll_wait() and similar. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Stop a pcap-related crash on errorMartin Schwenke2022-09-201-2/+5
| | | | | | | errbuf can't be NULL. Might as well use it. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Fix a warning in the pcap codeMartin Schwenke2022-09-201-2/+2
| | | | | | | | | | | [173/416] Compiling ctdb/common/system_socket.c ../../common/system_socket.c: In function ‘ctdb_sys_read_tcp_packet’: ../../common/system_socket.c:1016:15: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual] 1016 | eth = (struct ether_header *)buffer; | ^ Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Do not use raw socket when ENABLE_PCAP is definedMartin Schwenke2022-09-201-3/+3
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Move a misplaced commentMartin Schwenke2022-09-201-7/+6
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-build: Add --enable-pcap configure optionMartin Schwenke2022-09-201-1/+6
| | | | | | | | | | | | | | | This forces the use pcap for packet capture on Linux. It appears that using a raw socket for capture does not work with infiniband - pcap support for that to come. Don't (yet?) change the default capture method to pcap. On some platforms (e.g. my personal Intel NUC, running Debian testing), pcap is much less reliable than the raw socket. However, pcap seems fine on most other platforms. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-build: Use pcap-config when availableMartin Schwenke2022-09-201-0/+6
| | | | | | | | | The build currently fails on AIX, which can't find the pcap headers because they're installed in a non-standard place. However, there is a pcap-config script available. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Reformat remaining test stubs with "shfmt -w -p -i 0 -fn"Martin Schwenke2022-09-1626-573/+647
| | | | | | | | 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 Sep 16 04:35:09 UTC 2022 on sn-devel-184
* ctdb-tests: Include eventscript stub commands in shellcheck testMartin Schwenke2022-09-161-0/+4
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Avoid shellcheck warnings in remaining test stubsMartin Schwenke2022-09-1610-44/+64
| | | | | | | A small amount of effort... Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Simplify determination of real interfaceMartin Schwenke2022-09-161-17/+7
| | | | | | | This can now be made trivial. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Implement "ip -brief link show" in ip stubMartin Schwenke2022-09-161-4/+30
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Avoid ShellCheck warningsMartin Schwenke2022-09-161-38/+42
| | | | | | | | Although this is a test stub, it is complicated enough to encourage ShellCheck cleanliness. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Reformat script with "shfmt -w -p -i 0 -fn"Martin Schwenke2022-09-161-524/+648
| | | | | | | As per current Samba convention. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Drop assumption that there are VLANs with no '@'Martin Schwenke2022-09-161-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VLAN configuration on Linux often uses a convention of naming a VLAN on <iface> with VLAN ID <tag> as <iface>.<tag>. To be able to monitor the underlying interface, the original 10.interface code naively simply stripped off the '.' and everything after (i.e. ".*", as a glob pattern). Some users do not use the above convention. A VLAN can be named without including the underlying interface, but still with a tag (e.g. vlan<tag> - the word "vlan" following by the tag) or, more generally, perhaps without a tag (e.g. <vlan> - an arbitrary name). The ip(8) command lists a VLAN as <vlan>@<iface>. The underlying interface can be found by stripping everything up to and including an '@' (i.e. "*@"). Commit bc71251433ce618c95c674d7cbe75b01a94adad9 added support for stripping "*@". However, on suspicion, it kept support for the case where there is no '@', falling back to stripping ".*". If ip(8) ever did this then it was a long time ago - it has been printing a format including '@' since at least 2004. Stripping ".*" interferes with interesting administrative decisions, like having '.' in interface names. So, drop the fallback to stripping ".*" because it appears to be unnecessary and can cause inconvenience. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* Fix spelling mistakes.Michael Tokarev2022-09-121-1/+1
| | | | | | | | | Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Sep 12 02:29:32 UTC 2022 on sn-devel-184
* ctdb-tests: Avoid shellcheck warningsMartin Schwenke2022-08-251-3/+5
| | | | | | | | | | | | | | | Mostly SC2086: Double quote to prevent globbing and word splitting. Use ctdb_onnode() where it simplifies code. No behaviour changes intended. 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 Aug 25 16:15:45 UTC 2022 on sn-devel-184
* ctdb-tests: Simplify IP address checkingMartin Schwenke2022-08-251-19/+10
| | | | | | | | | | | Use a new function and wait_until() to simplify. get_test_ip_mask_and_iface() not needed here because select_test_node_and_ips() sets $test_ip, and neither $mask nor $iface is used. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Fix typosMartin Schwenke2022-08-251-2/+2
| | | | | | | | | | | | | | | | These lines are just wrong: try_command_on_node -v $test_node "ip addr show to ${test_node}" if -n "$out"; then The 2nd variable referenced should be $test_ip. The 2nd line causes "-n: command not found" because it is missing [] test command brackets. Both typos would probably make the test pass unconditionally. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Reformat script using shfmt -w -p -i 0 -fnMartin Schwenke2022-08-251-12/+12
| | | | | | | Whitespace changes only. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>