summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2022-01-10 14:15:25 +1100
committerMartin Schwenke <martins@samba.org>2022-01-17 10:21:33 +0000
commit1dfb266038f6fdf971bb0ffe0726f778b986371d (patch)
tree98c29797228e6f7ae2395759324fa85250db53fd /ctdb
parentf5a39058f0743f5607df91cb698a2b15618e1360 (diff)
downloadsamba-1dfb266038f6fdf971bb0ffe0726f778b986371d.tar.gz
ctdb-config: [legacy] recmaster capability -> [cluster] leader capability
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>
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/cluster/cluster_conf.c5
-rw-r--r--ctdb/cluster/cluster_conf.h1
-rw-r--r--ctdb/doc/ctdb.7.xml12
-rw-r--r--ctdb/doc/ctdb.conf.5.xml48
-rw-r--r--ctdb/server/ctdb_config.c8
-rw-r--r--ctdb/server/ctdb_config.h2
-rw-r--r--ctdb/server/ctdbd.c2
-rw-r--r--ctdb/server/legacy_conf.c5
-rw-r--r--ctdb/server/legacy_conf.h1
-rwxr-xr-xctdb/tests/UNIT/cunit/config_test_001.sh2
-rwxr-xr-xctdb/tests/UNIT/cunit/config_test_004.sh14
-rwxr-xr-xctdb/tests/UNIT/cunit/config_test_006.sh5
12 files changed, 57 insertions, 48 deletions
diff --git a/ctdb/cluster/cluster_conf.c b/ctdb/cluster/cluster_conf.c
index 3b86bad80ef..c2fd3e1fe78 100644
--- a/ctdb/cluster/cluster_conf.c
+++ b/ctdb/cluster/cluster_conf.c
@@ -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);
}
diff --git a/ctdb/cluster/cluster_conf.h b/ctdb/cluster/cluster_conf.h
index cdd42e15b7d..32334f1a5b4 100644
--- a/ctdb/cluster/cluster_conf.h
+++ b/ctdb/cluster/cluster_conf.h
@@ -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);
diff --git a/ctdb/doc/ctdb.7.xml b/ctdb/doc/ctdb.7.xml
index 6b5391e9d44..74ec421a526 100644
--- a/ctdb/doc/ctdb.7.xml
+++ b/ctdb/doc/ctdb.7.xml
@@ -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>
diff --git a/ctdb/doc/ctdb.conf.5.xml b/ctdb/doc/ctdb.conf.5.xml
index 910ac4102f6..ae65f8fae4b 100644
--- a/ctdb/doc/ctdb.conf.5.xml
+++ b/ctdb/doc/ctdb.conf.5.xml
@@ -195,6 +195,30 @@
</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>
<para>
@@ -498,30 +522,6 @@
</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>
<para>
diff --git a/ctdb/server/ctdb_config.c b/ctdb/server/ctdb_config.c
index 17e697996ab..5eabf36501c 100644
--- a/ctdb/server/ctdb_config.c
+++ b/ctdb/server/ctdb_config.c
@@ -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
@@ -109,10 +113,6 @@ static void setup_config_pointers(struct conf_context *conf)
&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,
&ctdb_config.lmaster_capability);
conf_assign_boolean_pointer(conf,
diff --git a/ctdb/server/ctdb_config.h b/ctdb/server/ctdb_config.h
index f079d495445..1749038617f 100644
--- a/ctdb/server/ctdb_config.h
+++ b/ctdb/server/ctdb_config.h
@@ -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;
diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c
index e333d7cb7cb..3bb20450a7f 100644
--- a/ctdb/server/ctdbd.c
+++ b/ctdb/server/ctdbd.c
@@ -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;
}
diff --git a/ctdb/server/legacy_conf.c b/ctdb/server/legacy_conf.c
index 5be8da0dab0..3391a3bdb54 100644
--- a/ctdb/server/legacy_conf.c
+++ b/ctdb/server/legacy_conf.c
@@ -59,11 +59,6 @@ void legacy_conf_init(struct conf_context *conf)
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,
true,
NULL);
diff --git a/ctdb/server/legacy_conf.h b/ctdb/server/legacy_conf.h
index 5551f12d76c..b6b4b5738f6 100644
--- a/ctdb/server/legacy_conf.h
+++ b/ctdb/server/legacy_conf.h
@@ -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"
diff --git a/ctdb/tests/UNIT/cunit/config_test_001.sh b/ctdb/tests/UNIT/cunit/config_test_001.sh
index b4a64ab790c..1f674a62b32 100755
--- a/ctdb/tests/UNIT/cunit/config_test_001.sh
+++ b/ctdb/tests/UNIT/cunit/config_test_001.sh
@@ -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
diff --git a/ctdb/tests/UNIT/cunit/config_test_004.sh b/ctdb/tests/UNIT/cunit/config_test_004.sh
index bebf7946bf6..bcfcc80e0ad 100755
--- a/ctdb/tests/UNIT/cunit/config_test_004.sh
+++ b/ctdb/tests/UNIT/cunit/config_test_004.sh
@@ -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
diff --git a/ctdb/tests/UNIT/cunit/config_test_006.sh b/ctdb/tests/UNIT/cunit/config_test_006.sh
index 11b23fce0e5..622fb665844 100755
--- a/ctdb/tests/UNIT/cunit/config_test_006.sh
+++ b/ctdb/tests/UNIT/cunit/config_test_006.sh
@@ -26,11 +26,6 @@ unit_test ctdb-config get "legacy" "realtime scheduling"
ok <<EOF
true
EOF
-unit_test ctdb-config get "legacy" "recmaster capability"
-
-ok <<EOF
-true
-EOF
unit_test ctdb-config get "legacy" "lmaster capability"
ok <<EOF