The branch, master has been updated
via 38b2428d376 ctdb-daemon: Hex encode key before logging
via 59ef918c03f util: Avoid signed/unsigned integer comparisons
via df6acb9760e ctdb-tests: Fix tunables test when run as root
via 0274c33831c ctdb-doc: Improve private and public network
documentation
via d19ad0bec55 ctdb-common: Use if_nametoindex(3) to check if
interface exists
via d2f93469d50 ctdb-common: Align integer type
via 6b76a13b086 ctdb-scripts: Move NFS lock manager grace hack to
callout
via 817d5b23efe ctdb-scripts: Reformat with "shfmt -w -p -i 0 -fn"
from 9d083a28fe4 manpages: Update NET ADS KERBEROS KINIT manpage
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 38b2428d3765a468004265b5732cbcadfe503bb9
Author: Martin Schwenke <[email protected]>
Date: Mon Feb 9 10:03:04 2026 +1100
ctdb-daemon: Hex encode key before logging
This currently causes binary data to be logged.
Instead, conditionally hex encode the key in a similar style to the
way it is done in dbwrap_ctdb.c:fetch_locked_internal(). In this
case, the key is truncated if the debug level is less than 10.`
Signed-off-by: Martin Schwenke <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
Autobuild-User(master): Volker Lendecke <[email protected]>
Autobuild-Date(master): Mon Feb 9 12:21:08 UTC 2026 on atb-devel-224
commit 59ef918c03f78f8ef2a19c504fd40f7e7368e905
Author: Martin Schwenke <[email protected]>
Date: Sun Sep 22 16:37:50 2024 +1000
util: Avoid signed/unsigned integer comparisons
../../../lib/util/sys_rw.c: In function ‘sys_pread_full’:
../../../lib/util/sys_rw.c:219:25: warning: comparison of integer
expressions of different signedness: ‘ssize_t’ {aka ‘long int’} and ‘size_t’
{aka ‘long unsigned int’} [-Wsign-compare]
219 | if (ret > curr_count) {
| ^
../../../lib/util/sys_rw.c: In function ‘sys_pwrite_full’:
../../../lib/util/sys_rw.c:282:25: warning: comparison of integer
expressions of different signedness: ‘ssize_t’ {aka ‘long int’} and ‘size_t’
{aka ‘long unsigned int’} [-Wsign-compare]
282 | if (ret > curr_count) {
| ^
../../../lib/util/sys_rw.c: In function ‘sys_write_full’:
../../../lib/util/sys_rw.c:321:25: warning: comparison of integer
expressions of different signedness: ‘ssize_t’ {aka ‘long int’} and ‘size_t’
{aka ‘long unsigned int’} [-Wsign-compare]
321 | if (ret > curr_count) {
| ^
Signed-off-by: Martin Schwenke <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
commit df6acb9760efa7b0f91e5b9bf6ec7cba1d5e31be
Author: Martin Schwenke <[email protected]>
Date: Sat Feb 7 15:51:06 2026 +1100
ctdb-tests: Fix tunables test when run as root
When run as root, this test's expected output is missing:
Loading tunables from ...
at the top.
Fix this by using the correct function to construct the expected
output.
Signed-off-by: Martin Schwenke <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
commit 0274c33831c91f87055745acb6e37919381bc8b9
Author: Martin Schwenke <[email protected]>
Date: Wed Jan 14 15:30:55 2026 +1100
ctdb-doc: Improve private and public network documentation
Signed-off-by: Martin Schwenke <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
commit d19ad0bec55dccfc1891c320a2fed41cc139927f
Author: Martin Schwenke <[email protected]>
Date: Mon Jan 12 18:05:23 2026 +1100
ctdb-common: Use if_nametoindex(3) to check if interface exists
This is much simpler than looping through the array. It will also
find an interface by altname, which could be very useful.
Signed-off-by: Martin Schwenke <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
commit d2f93469d50916d355d718d48e83768af6997052
Author: Martin Schwenke <[email protected]>
Date: Mon Nov 17 10:20:11 2025 +1100
ctdb-common: Align integer type
[132/416] Compiling ctdb/common/run_event.c
../../common/run_event.c: In function ‘run_event_fail’:
../../common/run_event.c:806:50: warning: comparison of integer expressions
of different signedness: ‘id_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
806 | if (script->summary == -ETIMEDOUT && pid != -1) {
| ^~
This is actually due to a typo in commit
20e9f203627752c4c1934e4bc0776e26c0dfb00e. It should always have been
pid_t.
Signed-off-by: Martin Schwenke <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
commit 6b76a13b0861755b804aedb7a3ca009bda6e8478
Author: Martin Schwenke <[email protected]>
Date: Fri May 2 09:15:08 2025 +1000
ctdb-scripts: Move NFS lock manager grace hack to callout
The "startipreallocate" event was added so the NFS-Ganesha callout
could use it to start grace. Use it for Linux kernel lock manager
grace too.
Signed-off-by: Martin Schwenke <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
commit 817d5b23efe03802ec423cff333d635378449290
Author: Martin Schwenke <[email protected]>
Date: Sun Jul 6 16:20:10 2025 +1000
ctdb-scripts: Reformat with "shfmt -w -p -i 0 -fn"
Best reviewed with "git show -w" or similar.
I now have a pre-commit hook to avoid formatting breakage. :-)
Signed-off-by: Martin Schwenke <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
-----------------------------------------------------------------------
Summary of changes:
ctdb/common/run_event.c | 4 ++--
ctdb/common/system.c | 30 ++++++------------------------
ctdb/config/nfs-linux-kernel-callout | 27 ++++++++++++++++++++++++---
ctdb/doc/ctdb.7.xml | 19 ++++++++++++++++++-
ctdb/server/ctdb_vacuum.c | 15 ++++++++++++---
ctdb/tests/UNIT/cunit/tunable_test_001.sh | 2 +-
ctdb/tools/statd_callout_helper | 10 ----------
lib/util/sys_rw.c | 6 +++---
8 files changed, 66 insertions(+), 47 deletions(-)
Changeset truncated at 500 lines:
diff --git a/ctdb/common/run_event.c b/ctdb/common/run_event.c
index dee46ad2949..4434fc18804 100644
--- a/ctdb/common/run_event.c
+++ b/ctdb/common/run_event.c
@@ -548,7 +548,7 @@ static struct tevent_req *run_event_run_script(struct
tevent_req *req);
static void run_event_next_script(struct tevent_req *subreq);
static void run_event_fail(struct tevent_req *req,
struct run_event_script *script,
- id_t pid);
+ pid_t pid);
static void run_event_debug(struct tevent_req *req, pid_t pid);
static void run_event_debug_done(struct tevent_req *subreq);
@@ -791,7 +791,7 @@ static void run_event_next_script(struct tevent_req *subreq)
static void run_event_fail(struct tevent_req *req,
struct run_event_script *script,
- id_t pid)
+ pid_t pid)
{
struct run_event_state *state = tevent_req_data(
req, struct run_event_state);
diff --git a/ctdb/common/system.c b/ctdb/common/system.c
index 05a95647233..170268c41fc 100644
--- a/ctdb/common/system.c
+++ b/ctdb/common/system.c
@@ -148,36 +148,18 @@ void ctdb_wait_for_process_to_exit(pid_t pid)
}
}
-#ifdef HAVE_IF_NAMEINDEX
+#ifdef HAVE_IF_NAMETOINDEX
bool ctdb_sys_check_iface_exists(const char *iface)
{
- struct if_nameindex *ifnis, *ifni;
- bool found = false;
+ unsigned int index = 0;
- ifnis = if_nameindex();
- if (ifnis == NULL) {
- DBG_ERR("Failed to retrieve interface list\n");
- return false;
- }
-
- for (ifni = ifnis;
- ifni->if_index != 0 || ifni->if_name != NULL;
- ifni++) {
- int cmp = strcmp(iface, ifni->if_name);
- if (cmp == 0) {
- found = true;
- goto done;
- }
- }
-
-done:
- if_freenameindex(ifnis);
+ index = if_nametoindex(iface);
- return found;
+ return index != 0;
}
-#else /* HAVE_IF_NAMEINDEX */
+#else /* HAVE_IF_NAMETOINDEX */
bool ctdb_sys_check_iface_exists(const char *iface)
{
@@ -185,7 +167,7 @@ bool ctdb_sys_check_iface_exists(const char *iface)
return true;
}
-#endif /* HAVE_IF_NAMEINDEX */
+#endif /* HAVE_IF_NAMETOINDEX */
#ifdef HAVE_PEERCRED
diff --git a/ctdb/config/nfs-linux-kernel-callout
b/ctdb/config/nfs-linux-kernel-callout
index cbc0482d73f..54857093138 100755
--- a/ctdb/config/nfs-linux-kernel-callout
+++ b/ctdb/config/nfs-linux-kernel-callout
@@ -203,7 +203,7 @@ service_stop()
pkill -9 nfsd
;;
nlockmgr)
- if service_is_defined "$nfs_lock_service" ; then
+ if service_is_defined "$nfs_lock_service"; then
service "$nfs_lock_service" stop >/dev/null 2>&1 || true
else
service "$nfs_service" stop >/dev/null 2>&1 || true
@@ -287,7 +287,7 @@ service_start()
nfs_service_start
;;
nlockmgr)
- if service_is_defined "$nfs_lock_service" ; then
+ if service_is_defined "$nfs_lock_service"; then
service "$nfs_lock_service" start
else
service "$nfs_service" start
@@ -326,6 +326,24 @@ nfs_startup()
fi
}
+##################################################
+# failover support
+
+nfs_startipreallocate()
+{
+ # Put the lock manager into grace
+ #
+ # We must let some time pass between stopping and restarting
+ # the lock manager. Otherwise there is a window where the
+ # lock manager will respond "strangely" immediately after
+ # restarting it, which causes clients to fail to reclaim their
+ # locks.
+ nfs_callout_init
+ service_stop "nlockmgr" >/dev/null 2>&1
+ sleep 2
+ service_start "nlockmgr" >/dev/null 2>&1
+}
+
##################################################
# monitor-post support
@@ -419,6 +437,9 @@ stop)
start)
service_start "$2"
;;
+startipreallocate)
+ nfs_startipreallocate
+ ;;
monitor-list-shares)
nfs_monitor_list_shares
;;
@@ -428,7 +449,7 @@ monitor-post)
register)
nfs_register
;;
-monitor-pre | releaseip | takeip | startipreallocate)
+monitor-pre | releaseip | takeip)
# Not required/implemented
:
;;
diff --git a/ctdb/doc/ctdb.7.xml b/ctdb/doc/ctdb.7.xml
index be2dd5e5b65..bb280d058a5 100644
--- a/ctdb/doc/ctdb.7.xml
+++ b/ctdb/doc/ctdb.7.xml
@@ -241,6 +241,15 @@
Private addresses should not be used by clients to connect to
services provided by the cluster.
</para>
+
+ <para>
+ Note that CTDB is not resilient to private network interface
+ failures. CTDB will notice when a node becomes disconnected
+ and will exclude it from the cluster. Standard mechanisms
+ such as bonding can be used to improve resilience of the
+ private network.
+ </para>
+
<para>
It is strongly recommended that the private addresses are
configured on a private network that is separate from client
@@ -281,7 +290,15 @@
more other nodes in the cluster. This ensures that services
provided by all public addresses are always available to
clients, as long as there are nodes available capable of
- hosting this address.
+ hosting each address.
+ </para>
+
+ <para>
+ Note that public addresses must be on different networks to
+ private addresses. CTDB uses the private network to
+ coordinate failover of public addresses. This means that
+ public addresses can not be failed over if the private network
+ is not operational.
</para>
<para>
diff --git a/ctdb/server/ctdb_vacuum.c b/ctdb/server/ctdb_vacuum.c
index 7ff79ac5745..d896dd28910 100644
--- a/ctdb/server/ctdb_vacuum.c
+++ b/ctdb/server/ctdb_vacuum.c
@@ -362,9 +362,18 @@ static void fetch_record_migrate_callback(struct
ctdb_client_call_state *state)
goto done;
}
- D_INFO("Vacuum Fetch record, key=%.*s\n",
- (int)fetch->key.dsize,
- fetch->key.dptr);
+ if (DEBUGLEVEL >= DBGLVL_INFO) {
+ char *keystr = hex_encode_talloc(
+ fetch,
+ (unsigned char *)fetch->key.dptr,
+ fetch->key.dsize);
+
+ D_INFO(DEBUGLEVEL >= DBGLVL_DEBUG ?
+ "Vacuum Fetch record, key=%s\n" :
+ "Vacuum Fetch record, key=%.20s\n",
+ keystr ? keystr : "<UNKNOWN>");
+ TALLOC_FREE(keystr);
+ }
(void) ctdb_local_schedule_for_deletion(fetch_queue->ctdb_db,
&hdr,
diff --git a/ctdb/tests/UNIT/cunit/tunable_test_001.sh
b/ctdb/tests/UNIT/cunit/tunable_test_001.sh
index a639c8772cb..22df9fa4059 100755
--- a/ctdb/tests/UNIT/cunit/tunable_test_001.sh
+++ b/ctdb/tests/UNIT/cunit/tunable_test_001.sh
@@ -165,7 +165,7 @@ chmod a-r "$tfile"
uid=$(id -u)
# root can read unreadable files
if [ "$uid" = 0 ]; then
- ok_tunable_defaults
+ ok_tunable
else
required_error EINVAL <<EOF
ctdb_tunable_load_file: Failed to open ${tfile}
diff --git a/ctdb/tools/statd_callout_helper b/ctdb/tools/statd_callout_helper
index b4606470cf8..6ab466f74b2 100755
--- a/ctdb/tools/statd_callout_helper
+++ b/ctdb/tools/statd_callout_helper
@@ -435,16 +435,6 @@ notify)
dir=$(find_statd_sm_dir)
rm -f "${dir}/"* "${dir}.bak/"*
- # We must also let some time pass between stopping and
- # restarting the lock manager. Otherwise there is a window
- # where the lock manager will respond "strangely" immediately
- # after restarting it, which causes clients to fail to reclaim
- # their locks.
- nfs_callout_init
- "$CTDB_NFS_CALLOUT" "stop" "nlockmgr" >/dev/null 2>&1
- sleep 2
- "$CTDB_NFS_CALLOUT" "start" "nlockmgr" >/dev/null 2>&1
-
statd_state="${statd_callout_state_dir}/.statd_state"
list_records >"$statd_state"
diff --git a/lib/util/sys_rw.c b/lib/util/sys_rw.c
index 957eafb4aa8..aa3020c74ab 100644
--- a/lib/util/sys_rw.c
+++ b/lib/util/sys_rw.c
@@ -216,7 +216,7 @@ ssize_t sys_pread_full(int fd, void *buf, size_t count,
off_t off)
break;
}
- if (ret > curr_count) {
+ if ((size_t)ret > curr_count) {
errno = EIO;
return -1;
}
@@ -279,7 +279,7 @@ ssize_t sys_pwrite_full(int fd, const void *buf, size_t
count, off_t off)
return -1;
}
- if (ret > curr_count) {
+ if ((size_t)ret > curr_count) {
errno = EIO;
return -1;
}
@@ -318,7 +318,7 @@ ssize_t sys_write_full(int fd, const void *buf, size_t
count)
return -1;
}
- if (ret > curr_count) {
+ if ((size_t)ret > curr_count) {
errno = EIO;
return -1;
}
--
Samba Shared Repository