ctdb-config: [legacy] recmaster capability -> [cluster] leader capability
authorMartin Schwenke <martin@meltin.net>
Mon, 10 Jan 2022 03:15:25 +0000 (14:15 +1100)
committerMartin Schwenke <martins@samba.org>
Mon, 17 Jan 2022 10:21:33 +0000 (10:21 +0000)
Rename this configuration item and move it into the [cluster]
configuration section.

Update documentation to match.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
12 files changed:
ctdb/cluster/cluster_conf.c
ctdb/cluster/cluster_conf.h
ctdb/doc/ctdb.7.xml
ctdb/doc/ctdb.conf.5.xml
ctdb/server/ctdb_config.c
ctdb/server/ctdb_config.h
ctdb/server/ctdbd.c
ctdb/server/legacy_conf.c
ctdb/server/legacy_conf.h
ctdb/tests/UNIT/cunit/config_test_001.sh
ctdb/tests/UNIT/cunit/config_test_004.sh
ctdb/tests/UNIT/cunit/config_test_006.sh

index 3b86bad80efed8dee39d4ae6487c4dd03f771e87..c2fd3e1fe7873ebe2d8901cb35b571f0b39f9dfc 100644 (file)
@@ -155,4 +155,9 @@ void cluster_conf_init(struct conf_context *conf)
                           CLUSTER_CONF_RECOVERY_LOCK,
                           NULL,
                           validate_recovery_lock);
+       conf_define_boolean(conf,
+                           CLUSTER_CONF_SECTION,
+                           CLUSTER_CONF_LEADER_CAPABILITY,
+                           true,
+                           NULL);
 }
index cdd42e15b7deee0038936f12e6b7c4533e1be467..32334f1a5b4fa0f031087d7a58905e7beccc9c85 100644 (file)
@@ -28,6 +28,7 @@
 #define CLUSTER_CONF_NODE_ADDRESS    "node address"
 #define CLUSTER_CONF_CLUSTER_LOCK    "cluster lock"
 #define CLUSTER_CONF_RECOVERY_LOCK   "recovery lock"
+#define CLUSTER_CONF_LEADER_CAPABILITY "leader capability"
 
 void cluster_conf_init(struct conf_context *conf);
 
index 6b5391e9d44f08a8e2b1c3ac342b5d2b23fb3c1a..74ec421a526373e1ce62d8b9d4287add9bc718fd 100644 (file)
@@ -478,11 +478,11 @@ Node 3:/usr/local/etc/ctdb/public_addresses
     <variablelist>
 
       <varlistentry>
-       <term>RECMASTER</term>
+       <term>LEADER</term>
        <listitem>
          <para>
-           Indicates that a node can become the CTDB cluster recovery
-           master.  The current recovery master is decided via an
+           Indicates that a node can become the CTDB cluster leader.
+           The current leader is decided via an
            election held by all active nodes with this capability.
          </para>
          <para>
@@ -508,7 +508,7 @@ Node 3:/usr/local/etc/ctdb/public_addresses
     </variablelist>
 
     <para>
-      The RECMASTER and LMASTER capabilities can be disabled when CTDB
+      The LEADER and LMASTER capabilities can be disabled when CTDB
       is used to create a cluster spanning across WAN links. In this
       case CTDB acts as a WAN accelerator.
     </para>
@@ -1088,13 +1088,13 @@ correct CIFS semantics to clients.
         <screen format="linespecific">
 [legacy]
   lmaster capability = false
-  recmaster capability = false
+  leader capability = false
        </screen>
     </para>
 
     <para>
        Verify with the command "ctdb getcapabilities" that that node no longer
-       has the recmaster or the lmaster capabilities.
+       has the leader or the lmaster capabilities.
     </para>
 
   </refsect1>
index 910ac4102f6576c01e6137fbc8b29dfd2054e104..ae65f8fae4bc6e976967043b42004b5cb3f65201 100644 (file)
        </listitem>
       </varlistentry>
 
+      <varlistentry>
+       <term>leader capability = true|false</term>
+       <listitem>
+         <para>
+           Indicates whether a node can become the leader
+           for the cluster. If this is set to
+           <literal>false</literal> then the node will not be able to
+           become the leader for the cluster. This feature
+           is primarily used for making a cluster span across a WAN
+           link and use CTDB as a WAN-accelerator.
+         </para>
+         <para>
+           Please see the <citetitle>REMOTE CLUSTER NODES</citetitle>
+           section in
+           <citerefentry><refentrytitle>ctdb</refentrytitle>
+           <manvolnum>7</manvolnum></citerefentry> for more
+           information.
+         </para>
+         <para>
+           Default: <literal>true</literal>
+         </para>
+       </listitem>
+      </varlistentry>
+
       <varlistentry>
        <term>node address = <parameter>IPADDR</parameter></term>
        <listitem>
        </listitem>
       </varlistentry>
 
-      <varlistentry>
-       <term>recmaster capability = true|false</term>
-       <listitem>
-         <para>
-           Indicates whether a node can become the recovery master
-           for the cluster. If this is set to
-           <literal>false</literal> then the node will not be able to
-           become the recovery master for the cluster. This feature
-           is primarily used for making a cluster span across a WAN
-           link and use CTDB as a WAN-accelerator.
-         </para>
-         <para>
-           Please see the <citetitle>REMOTE CLUSTER NODES</citetitle>
-           section in
-           <citerefentry><refentrytitle>ctdb</refentrytitle>
-           <manvolnum>7</manvolnum></citerefentry> for more
-           information.
-         </para>
-         <para>
-           Default: <literal>true</literal>
-         </para>
-       </listitem>
-      </varlistentry>
-
       <varlistentry>
        <term>lmaster capability = true|false</term>
        <listitem>
index 17e697996ab2a0e8fc9dff8285ddd72b69ad4724..5eabf36501c5fb188dd77cbe2efcc9a870de858d 100644 (file)
@@ -57,6 +57,10 @@ static void setup_config_pointers(struct conf_context *conf)
                                   CLUSTER_CONF_SECTION,
                                   CLUSTER_CONF_RECOVERY_LOCK,
                                   &ctdb_config.recovery_lock);
+       conf_assign_boolean_pointer(conf,
+                                   CLUSTER_CONF_SECTION,
+                                   CLUSTER_CONF_LEADER_CAPABILITY,
+                                   &ctdb_config.leader_capability);
 
        /*
         * Database
@@ -107,10 +111,6 @@ static void setup_config_pointers(struct conf_context *conf)
                                    LEGACY_CONF_SECTION,
                                    LEGACY_CONF_REALTIME_SCHEDULING,
                                    &ctdb_config.realtime_scheduling);
-       conf_assign_boolean_pointer(conf,
-                                   LEGACY_CONF_SECTION,
-                                   LEGACY_CONF_RECMASTER_CAPABILITY,
-                                   &ctdb_config.recmaster_capability);
        conf_assign_boolean_pointer(conf,
                                    LEGACY_CONF_SECTION,
                                    LEGACY_CONF_LMASTER_CAPABILITY,
index f079d495445d03f9d6ccf2f7c7ee628168e07f59..1749038617fc6bb8168bd106155635c1d797bc6f 100644 (file)
@@ -28,6 +28,7 @@ struct ctdb_config {
        const char *node_address;
        const char *cluster_lock;
        const char *recovery_lock;
+       bool leader_capability;
 
        /* Database */
        const char *dbdir_volatile;
@@ -44,7 +45,6 @@ struct ctdb_config {
 
        /* Legacy */
        bool realtime_scheduling;
-       bool recmaster_capability;
        bool lmaster_capability;
        bool start_as_stopped;
        bool start_as_disabled;
index e333d7cb7cb237ccff259712e9d9113384345792..3bb20450a7f46ba0745631fcb7288cc66d231969 100644 (file)
@@ -358,7 +358,7 @@ int main(int argc, const char *argv[])
        if (!ctdb_config.lmaster_capability) {
                ctdb->capabilities &= ~CTDB_CAP_LMASTER;
        }
-       if (!ctdb_config.recmaster_capability) {
+       if (!ctdb_config.leader_capability) {
                ctdb->capabilities &= ~CTDB_CAP_RECMASTER;
        }
 
index 5be8da0dab02a2d446258446c08feb759b5eeead..3391a3bdb54f38959fc5462dffd803d33adab2ce 100644 (file)
@@ -57,11 +57,6 @@ void legacy_conf_init(struct conf_context *conf)
                            LEGACY_CONF_REALTIME_SCHEDULING,
                            true,
                            NULL);
-       conf_define_boolean(conf,
-                           LEGACY_CONF_SECTION,
-                           LEGACY_CONF_RECMASTER_CAPABILITY,
-                           true,
-                           NULL);
        conf_define_boolean(conf,
                            LEGACY_CONF_SECTION,
                            LEGACY_CONF_LMASTER_CAPABILITY,
index 5551f12d76c8278a99ecab0181787b1513e6da95..b6b4b5738f66b027f469b3110a4873b5b9b052b8 100644 (file)
@@ -25,7 +25,6 @@
 #define LEGACY_CONF_SECTION "legacy"
 
 #define LEGACY_CONF_REALTIME_SCHEDULING  "realtime scheduling"
-#define LEGACY_CONF_RECMASTER_CAPABILITY "recmaster capability"
 #define LEGACY_CONF_LMASTER_CAPABILITY   "lmaster capability"
 #define LEGACY_CONF_START_AS_STOPPED     "start as stopped"
 #define LEGACY_CONF_START_AS_DISABLED    "start as disabled"
index b4a64ab790c978c404900bc6fe1430673d654302..1f674a62b32a3dce4067291039742077363c5456 100755 (executable)
@@ -36,6 +36,7 @@ ok <<EOF
        # node address = 
        # cluster lock = 
        # recovery lock = 
+       # leader capability = true
 [database]
        # volatile database directory = ${database_volatile_dbdir}
        # persistent database directory = ${database_persistent_dbdir}
@@ -48,7 +49,6 @@ ok <<EOF
        # disabled = false
 [legacy]
        # realtime scheduling = true
-       # recmaster capability = true
        # lmaster capability = true
        # start as stopped = false
        # start as disabled = false
index bebf7946bf60dce0afd45d9f23ac5b4e0505e377..bcfcc80e0ad20bab9e751ad2095ee5e2f81d7fc3 100755 (executable)
@@ -31,6 +31,11 @@ ok <<EOF
 EOF
 unit_test ctdb-config get "cluster" "cluster lock"
 
+ok <<EOF
+true
+EOF
+unit_test ctdb-config get "cluster" "leader capability"
+
 cat > "$conffile" <<EOF
 [cluster]
     transport = invalid
@@ -91,3 +96,12 @@ required_result 0 <<EOF
 Configuration option [cluster] -> recovery lock is deprecated
 EOF
 unit_test ctdb-config -d WARNING validate
+
+cat > "$conffile" <<EOF
+[cluster]
+    leader capability = false
+EOF
+
+required_result 0 <<EOF
+EOF
+unit_test ctdb-config validate
index 11b23fce0e5634aa3c51a8326a81cfff4da4611e..622fb665844fd6b37f897a930982c6600a7dce50 100755 (executable)
@@ -23,11 +23,6 @@ true
 EOF
 unit_test ctdb-config get "legacy" "realtime scheduling"
 
-ok <<EOF
-true
-EOF
-unit_test ctdb-config get "legacy" "recmaster capability"
-
 ok <<EOF
 true
 EOF