1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-03 01:18:10 +03:00

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>
This commit is contained in:
Martin Schwenke 2022-01-10 14:15:25 +11:00 committed by Martin Schwenke
parent f5a39058f0
commit 1dfb266038
12 changed files with 57 additions and 48 deletions

View File

@ -155,4 +155,9 @@ void cluster_conf_init(struct conf_context *conf)
CLUSTER_CONF_RECOVERY_LOCK, CLUSTER_CONF_RECOVERY_LOCK,
NULL, NULL,
validate_recovery_lock); validate_recovery_lock);
conf_define_boolean(conf,
CLUSTER_CONF_SECTION,
CLUSTER_CONF_LEADER_CAPABILITY,
true,
NULL);
} }

View File

@ -28,6 +28,7 @@
#define CLUSTER_CONF_NODE_ADDRESS "node address" #define CLUSTER_CONF_NODE_ADDRESS "node address"
#define CLUSTER_CONF_CLUSTER_LOCK "cluster lock" #define CLUSTER_CONF_CLUSTER_LOCK "cluster lock"
#define CLUSTER_CONF_RECOVERY_LOCK "recovery lock" #define CLUSTER_CONF_RECOVERY_LOCK "recovery lock"
#define CLUSTER_CONF_LEADER_CAPABILITY "leader capability"
void cluster_conf_init(struct conf_context *conf); void cluster_conf_init(struct conf_context *conf);

View File

@ -478,11 +478,11 @@ Node 3:/usr/local/etc/ctdb/public_addresses
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term>RECMASTER</term> <term>LEADER</term>
<listitem> <listitem>
<para> <para>
Indicates that a node can become the CTDB cluster recovery Indicates that a node can become the CTDB cluster leader.
master. The current recovery master is decided via an The current leader is decided via an
election held by all active nodes with this capability. election held by all active nodes with this capability.
</para> </para>
<para> <para>
@ -508,7 +508,7 @@ Node 3:/usr/local/etc/ctdb/public_addresses
</variablelist> </variablelist>
<para> <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 is used to create a cluster spanning across WAN links. In this
case CTDB acts as a WAN accelerator. case CTDB acts as a WAN accelerator.
</para> </para>
@ -1088,13 +1088,13 @@ correct CIFS semantics to clients.
<screen format="linespecific"> <screen format="linespecific">
[legacy] [legacy]
lmaster capability = false lmaster capability = false
recmaster capability = false leader capability = false
</screen> </screen>
</para> </para>
<para> <para>
Verify with the command "ctdb getcapabilities" that that node no longer 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> </para>
</refsect1> </refsect1>

View File

@ -194,6 +194,30 @@
</listitem> </listitem>
</varlistentry> </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> <varlistentry>
<term>node address = <parameter>IPADDR</parameter></term> <term>node address = <parameter>IPADDR</parameter></term>
<listitem> <listitem>
@ -497,30 +521,6 @@
</listitem> </listitem>
</varlistentry> </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> <varlistentry>
<term>lmaster capability = true|false</term> <term>lmaster capability = true|false</term>
<listitem> <listitem>

View File

@ -57,6 +57,10 @@ static void setup_config_pointers(struct conf_context *conf)
CLUSTER_CONF_SECTION, CLUSTER_CONF_SECTION,
CLUSTER_CONF_RECOVERY_LOCK, CLUSTER_CONF_RECOVERY_LOCK,
&ctdb_config.recovery_lock); &ctdb_config.recovery_lock);
conf_assign_boolean_pointer(conf,
CLUSTER_CONF_SECTION,
CLUSTER_CONF_LEADER_CAPABILITY,
&ctdb_config.leader_capability);
/* /*
* Database * Database
@ -107,10 +111,6 @@ static void setup_config_pointers(struct conf_context *conf)
LEGACY_CONF_SECTION, LEGACY_CONF_SECTION,
LEGACY_CONF_REALTIME_SCHEDULING, LEGACY_CONF_REALTIME_SCHEDULING,
&ctdb_config.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, conf_assign_boolean_pointer(conf,
LEGACY_CONF_SECTION, LEGACY_CONF_SECTION,
LEGACY_CONF_LMASTER_CAPABILITY, LEGACY_CONF_LMASTER_CAPABILITY,

View File

@ -28,6 +28,7 @@ struct ctdb_config {
const char *node_address; const char *node_address;
const char *cluster_lock; const char *cluster_lock;
const char *recovery_lock; const char *recovery_lock;
bool leader_capability;
/* Database */ /* Database */
const char *dbdir_volatile; const char *dbdir_volatile;
@ -44,7 +45,6 @@ struct ctdb_config {
/* Legacy */ /* Legacy */
bool realtime_scheduling; bool realtime_scheduling;
bool recmaster_capability;
bool lmaster_capability; bool lmaster_capability;
bool start_as_stopped; bool start_as_stopped;
bool start_as_disabled; bool start_as_disabled;

View File

@ -358,7 +358,7 @@ int main(int argc, const char *argv[])
if (!ctdb_config.lmaster_capability) { if (!ctdb_config.lmaster_capability) {
ctdb->capabilities &= ~CTDB_CAP_LMASTER; ctdb->capabilities &= ~CTDB_CAP_LMASTER;
} }
if (!ctdb_config.recmaster_capability) { if (!ctdb_config.leader_capability) {
ctdb->capabilities &= ~CTDB_CAP_RECMASTER; ctdb->capabilities &= ~CTDB_CAP_RECMASTER;
} }

View File

@ -57,11 +57,6 @@ void legacy_conf_init(struct conf_context *conf)
LEGACY_CONF_REALTIME_SCHEDULING, LEGACY_CONF_REALTIME_SCHEDULING,
true, true,
NULL); NULL);
conf_define_boolean(conf,
LEGACY_CONF_SECTION,
LEGACY_CONF_RECMASTER_CAPABILITY,
true,
NULL);
conf_define_boolean(conf, conf_define_boolean(conf,
LEGACY_CONF_SECTION, LEGACY_CONF_SECTION,
LEGACY_CONF_LMASTER_CAPABILITY, LEGACY_CONF_LMASTER_CAPABILITY,

View File

@ -25,7 +25,6 @@
#define LEGACY_CONF_SECTION "legacy" #define LEGACY_CONF_SECTION "legacy"
#define LEGACY_CONF_REALTIME_SCHEDULING "realtime scheduling" #define LEGACY_CONF_REALTIME_SCHEDULING "realtime scheduling"
#define LEGACY_CONF_RECMASTER_CAPABILITY "recmaster capability"
#define LEGACY_CONF_LMASTER_CAPABILITY "lmaster capability" #define LEGACY_CONF_LMASTER_CAPABILITY "lmaster capability"
#define LEGACY_CONF_START_AS_STOPPED "start as stopped" #define LEGACY_CONF_START_AS_STOPPED "start as stopped"
#define LEGACY_CONF_START_AS_DISABLED "start as disabled" #define LEGACY_CONF_START_AS_DISABLED "start as disabled"

View File

@ -36,6 +36,7 @@ ok <<EOF
# node address = # node address =
# cluster lock = # cluster lock =
# recovery lock = # recovery lock =
# leader capability = true
[database] [database]
# volatile database directory = ${database_volatile_dbdir} # volatile database directory = ${database_volatile_dbdir}
# persistent database directory = ${database_persistent_dbdir} # persistent database directory = ${database_persistent_dbdir}
@ -48,7 +49,6 @@ ok <<EOF
# disabled = false # disabled = false
[legacy] [legacy]
# realtime scheduling = true # realtime scheduling = true
# recmaster capability = true
# lmaster capability = true # lmaster capability = true
# start as stopped = false # start as stopped = false
# start as disabled = false # start as disabled = false

View File

@ -31,6 +31,11 @@ ok <<EOF
EOF EOF
unit_test ctdb-config get "cluster" "cluster lock" unit_test ctdb-config get "cluster" "cluster lock"
ok <<EOF
true
EOF
unit_test ctdb-config get "cluster" "leader capability"
cat > "$conffile" <<EOF cat > "$conffile" <<EOF
[cluster] [cluster]
transport = invalid transport = invalid
@ -91,3 +96,12 @@ required_result 0 <<EOF
Configuration option [cluster] -> recovery lock is deprecated Configuration option [cluster] -> recovery lock is deprecated
EOF EOF
unit_test ctdb-config -d WARNING validate 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

View File

@ -23,11 +23,6 @@ true
EOF EOF
unit_test ctdb-config get "legacy" "realtime scheduling" unit_test ctdb-config get "legacy" "realtime scheduling"
ok <<EOF
true
EOF
unit_test ctdb-config get "legacy" "recmaster capability"
ok <<EOF ok <<EOF
true true
EOF EOF