Possible bug in ctdb

Ralph Boehme slow at samba.org
Thu Feb 25 12:05:52 UTC 2021


Hi Martin, Amitay,

I noticed the following if condition in check_static_boolean_change() 
(defined twice):

     if (mode == CONF_MODE_RELOAD || CONF_MODE_API)

This will always evaluate to true, I guess that is not intended and the 
fix would be

     if (mode == CONF_MODE_RELOAD || mode == CONF_MODE_API)

(WIP attached, lacking bugnumber).

I'm currently debugging a ctdb issue where I wondered whether tdb 
mutexes are actually enabled (I was seeing "tdb_chain*un*lock() took 
+-10 ms" many times in the logs).

"tdb mutexes" defaults to true, so I wonder whether this bug can cause 
the default to not become effective, still wrapping my hear around the 
ctdb config code...

Thoughts?
-slow

-- 
Ralph Boehme, Samba Team                https://samba.org/
Samba Developer, SerNet GmbH   https://sernet.de/en/samba/
GPG-Fingerprint   FAE2C6088A24252051C559E4AA1E9B7126399E46
-------------- next part --------------
From 4174ace55573d8954cd97e931ebc3ae56abea1f4 Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Thu, 25 Feb 2021 12:58:15 +0100
Subject: [PATCH] ctdb: fix enum check

BUG: ...
---
 ctdb/database/database_conf.c | 2 +-
 ctdb/failover/failover_conf.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ctdb/database/database_conf.c b/ctdb/database/database_conf.c
index 4c7cb2d9ffe..74b74a824cc 100644
--- a/ctdb/database/database_conf.c
+++ b/ctdb/database/database_conf.c
@@ -59,7 +59,7 @@ static bool check_static_boolean_change(const char *key,
 					bool new_value,
 					enum conf_update_mode mode)
 {
-	if (mode == CONF_MODE_RELOAD || CONF_MODE_API) {
+	if (mode == CONF_MODE_RELOAD || mode == CONF_MODE_API) {
 		if (old_value != new_value) {
 			D_WARNING("Ignoring update of [%s] -> %s\n",
 				  DATABASE_CONF_SECTION,
diff --git a/ctdb/failover/failover_conf.c b/ctdb/failover/failover_conf.c
index 0f199cbcd6c..61feede39c2 100644
--- a/ctdb/failover/failover_conf.c
+++ b/ctdb/failover/failover_conf.c
@@ -30,7 +30,7 @@ static bool check_static_boolean_change(const char *key,
 					bool new_value,
 					enum conf_update_mode mode)
 {
-	if (mode == CONF_MODE_RELOAD || CONF_MODE_API) {
+	if (mode == CONF_MODE_RELOAD || mode == CONF_MODE_API) {
 		if (old_value != new_value) {
 			D_WARNING("Ignoring update of [%s] -> %s\n",
 				  FAILOVER_CONF_SECTION,
-- 
2.29.2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20210225/1ae23012/OpenPGP_signature.sig>


More information about the samba-technical mailing list