From e0e12be1fee4b5b6acba40aee0fde89f41147fa1 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Tue, 11 Mar 2025 09:39:10 -0400 Subject: [PATCH 1/2] sambacc: add a specifics flag for mutex helper registration option Add a new samba specifics flag that indicates that the ctdb_mutex_ceph_rados_helper program supports the -R option to skip registering the helper as a ceph service. Signed-off-by: John Mulligan --- sambacc/samba_cmds.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sambacc/samba_cmds.py b/sambacc/samba_cmds.py index 6614b631..177aa971 100644 --- a/sambacc/samba_cmds.py +++ b/sambacc/samba_cmds.py @@ -31,6 +31,7 @@ # Known flags for SAMBA_SPECIFICS env variable _DAEMON_CLI_STDOUT_OPT: str = "daemon_cli_debug_output" _CTDB_LEADER_ADMIN_CMD: str = "ctdb_leader_admin_command" +_CTDB_RADOS_MUTEX_SKIP_REG: str = "ctdb_rados_mutex_skip_reg" def get_samba_specifics() -> typing.Set[str]: @@ -61,6 +62,12 @@ def ctdb_leader_admin_cmd() -> str: return leader_cmd +def ctdb_rados_mutex_skip_registration_opt() -> str: + if _CTDB_RADOS_MUTEX_SKIP_REG in get_samba_specifics(): + return "-R" # skip registration option + return "" + + def set_global_prefix(lst: list[str]) -> None: _GLOBAL_PREFIX[:] = lst From 5d1dde8bb02a849087126e45c2a552d6ebe02891 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Tue, 11 Mar 2025 09:39:10 -0400 Subject: [PATCH 2/2] commands: when possible skip ceph service registration for mutex helper When the ctdb ceph rados mutex helper tool supports the -R option to skip registering the helper as a ceph service - do so. This avoids confusion on the ceph side as the helper will act more like a typical rados client than something on the level of an OSD or MDS. Signed-off-by: John Mulligan --- sambacc/commands/ctdb.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sambacc/commands/ctdb.py b/sambacc/commands/ctdb.py index 421bb007..2104cb0a 100644 --- a/sambacc/commands/ctdb.py +++ b/sambacc/commands/ctdb.py @@ -469,6 +469,10 @@ def ctdb_rados_mutex(ctx: Context) -> None: # optional namespace argument if namespace: cmd = cmd["-n", namespace] + skip_reg_option = samba_cmds.ctdb_rados_mutex_skip_registration_opt() + if skip_reg_option: + # skip registring ctdb rados mutex helper as a service + cmd = cmd[skip_reg_option] _logger.debug("executing command: %r", cmd) samba_cmds.execute(cmd) # replaces process