The branch, master has been updated
       via  6f912b811f1 ctdb/doc: document the newly added option to not 
register the helper
       via  9a713fdf76c ctdb/ceph: add option to not register mutex rados 
helper as a service
      from  c1cac5967eb manpages:samba-tool: sort 'service-account' into place 
alphabetically

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 6f912b811f1094ba69c16fb9f11a80b29f0ab69c
Author: John Mulligan <[email protected]>
Date:   Mon Mar 10 16:47:10 2025 -0400

    ctdb/doc: document the newly added option to not register the helper
    
    Add the newly established -R (no-register) option to allow skipping the
    registration of the helper as a ceph service.
    
    Signed-off-by: John Mulligan <[email protected]>
    Reviewed-by: Guenther Deschner <[email protected]>
    Reviewed-by: Anoop C S <[email protected]>
    
    Autobuild-User(master): Anoop C S <[email protected]>
    Autobuild-Date(master): Fri Mar 14 09:42:02 UTC 2025 on atb-devel-224

commit 9a713fdf76c7b5d16e686d8b17b24bdc70ae3208
Author: John Mulligan <[email protected]>
Date:   Tue Mar 4 15:43:52 2025 -0500

    ctdb/ceph: add option to not register mutex rados helper as a service
    
    Add a new `-R` option (no-register) that will skip the step of
    registering the lock helper as a ceph service. Ceph will treat the lock
    helper more like a typical rados client. The `ceph -s` output will not
    have ctdb listed under the services section (previous output):
    ```
      cluster:
        id:     5b81295a-fdec-11ef-a18f-525400220000
        health: HEALTH_WARN
                1 stray daemon(s) not managed by cephadm
    
      services:
        mon:  3 daemons, quorum ceph0,ceph1,ceph2 (age 6m)
        mgr:  ceph0.mkodry(active, since 85s)
        mds:  1/1 daemons up
        osd:  6 osds: 6 up (since 52m), 6 in (since 52m)
        ctdb: 1 daemon active (1 hosts)
    ```
    
    Most importantly, this will avoid triggering health warnings from ceph
    when cephadm discovers services that it did not create (or directly
    manage) listed in the cluster.  Something we looked into hiding on the
    cephadm side but proved quite tricky so it's better off not to try this
    registration on cephadm managed clusters in the first place.
    
    In addition, the `1 daemon active` bit is somewhat confusing when you
    have a N (N>1) node ctdb cluster managed by cephadm. The fact that the
    mutex helper only runs on one of those nodes at once is a low level
    implementation detail that most users do not need and I assume could
    confuse.
    
    Signed-off-by: John Mulligan <[email protected]>
    Reviewed-by: Guenther Deschner <[email protected]>
    Reviewed-by: Anoop C S <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 ctdb/doc/ctdb_mutex_ceph_rados_helper.7.xml    |  3 ++-
 ctdb/utils/ceph/ctdb_mutex_ceph_rados_helper.c | 16 +++++++++++-----
 2 files changed, 13 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/doc/ctdb_mutex_ceph_rados_helper.7.xml 
b/ctdb/doc/ctdb_mutex_ceph_rados_helper.7.xml
index 93d79cea5dc..9bd17f41aa7 100644
--- a/ctdb/doc/ctdb_mutex_ceph_rados_helper.7.xml
+++ b/ctdb/doc/ctdb_mutex_ceph_rados_helper.7.xml
@@ -29,7 +29,7 @@
       <manvolnum>5</manvolnum></citerefentry>:
     </para>
     <screen format="linespecific">
-cluster lock = !ctdb_mutex_ceph_rados_helper [Cluster] [User] [Pool] [Object] 
[Timeout] [-n Namespace]
+cluster lock = !ctdb_mutex_ceph_rados_helper [Cluster] [User] [Pool] [Object] 
[Timeout] [-n Namespace] [-R]
 
 Cluster: Ceph cluster name (e.g. ceph)
 User: Ceph cluster user name (e.g. client.admin)
@@ -37,6 +37,7 @@ Pool: Ceph RADOS pool name
 Object: Ceph RADOS object name
 Timeout: Ceph RADOS lock duration in seconds (optional)
 Namespace: Ceph RADOS pool namespace (optional)
+No-register (-R): Skip registering the mutex helper as a ceph service
     </screen>
     <para>
       The Ceph cluster <parameter>Cluster</parameter> must be up and running,
diff --git a/ctdb/utils/ceph/ctdb_mutex_ceph_rados_helper.c 
b/ctdb/utils/ceph/ctdb_mutex_ceph_rados_helper.c
index 46566c97a83..7dd6ea1e889 100644
--- a/ctdb/utils/ceph/ctdb_mutex_ceph_rados_helper.c
+++ b/ctdb/utils/ceph/ctdb_mutex_ceph_rados_helper.c
@@ -311,6 +311,7 @@ int main(int argc, char *argv[])
        int ret;
        int opt;
        struct ctdb_mutex_rados_state *cmr_state;
+       bool skip_registering = false;
 
        progname = argv[0];
 
@@ -339,11 +340,14 @@ int main(int argc, char *argv[])
        cmr_state->object = argv[4];
 
        optind = 5;
-       while ((opt = getopt(argc, argv, "n:")) != -1) {
+       while ((opt = getopt(argc, argv, "n:R")) != -1) {
                switch(opt) {
                case 'n':
                        cmr_state->namespace = optarg;
                        break;
+               case 'R':
+                       skip_registering = true;
+                       break;
                default:
                        usage();
                        ret = -EINVAL;
@@ -439,10 +443,12 @@ int main(int argc, char *argv[])
                goto err_ctx_cleanup;
        }
 
-       ret = ctdb_mutex_rados_mgr_reg(cmr_state->ceph_cluster);
-       if (ret < 0) {
-               fprintf(stderr, "Failed to register with ceph-mgr\n");
-               /* ignore: ceph-mgr service registration is informational */
+       if (!skip_registering) {
+               ret = ctdb_mutex_rados_mgr_reg(cmr_state->ceph_cluster);
+               if (ret < 0) {
+                       fprintf(stderr, "Failed to register with ceph-mgr\n");
+                       /* ignore: ceph-mgr service registration is 
informational */
+               }
        }
 
        ret = ctdb_mutex_rados_lock(cmr_state->ioctx, cmr_state->object,


-- 
Samba Shared Repository

Reply via email to