From f37b3cf2a64e066d4f261d453233dc9a0988aed7 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Fri, 17 Jul 2020 20:46:07 +1000 Subject: ctdb: Change LVS to use leader/follower Instead of master/slave. Nearly all of these are simple textual substitutions, which preserve the case of the original. A couple of minor cleanups were made in the documentation (such as "LVSMASTER" -> "LVS leader"). Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/config/events/legacy/91.lvs.script | 12 ++++++------ ctdb/doc/ctdb-script.options.5.xml | 8 ++++---- ctdb/doc/ctdb.1.xml | 6 +++--- ctdb/doc/ctdb.7.xml | 22 +++++++++++----------- .../UNIT/eventscripts/91.lvs.ipreallocated.012.sh | 2 +- .../UNIT/eventscripts/91.lvs.ipreallocated.013.sh | 4 ++-- .../UNIT/eventscripts/91.lvs.ipreallocated.014.sh | 4 ++-- ctdb/tests/UNIT/eventscripts/scripts/91.lvs.sh | 10 +++++----- ctdb/tests/UNIT/eventscripts/stubs/ctdb_lvs | 10 +++++----- ctdb/tests/UNIT/tool/ctdb.lvs.001.sh | 2 +- ctdb/tests/UNIT/tool/ctdb.lvs.002.sh | 2 +- ctdb/tests/UNIT/tool/ctdb.lvs.003.sh | 2 +- ctdb/tests/UNIT/tool/ctdb.lvs.004.sh | 2 +- ctdb/tests/UNIT/tool/ctdb.lvs.005.sh | 2 +- ctdb/tests/UNIT/tool/ctdb.lvs.006.sh | 2 +- ctdb/tests/UNIT/tool/ctdb.lvs.007.sh | 2 +- ctdb/tests/UNIT/tool/ctdb.lvs.008.sh | 2 +- ctdb/tools/ctdb.c | 2 +- ctdb/tools/ctdb_lvs | 16 ++++++++-------- 19 files changed, 56 insertions(+), 56 deletions(-) diff --git a/ctdb/config/events/legacy/91.lvs.script b/ctdb/config/events/legacy/91.lvs.script index b3d65f44607..05f0431b661 100755 --- a/ctdb/config/events/legacy/91.lvs.script +++ b/ctdb/config/events/legacy/91.lvs.script @@ -19,11 +19,11 @@ if ! type ipvsadm >/dev/null 2>&1 ; then fi -lvs_slave_only () +lvs_follower_only () { _ip_address=$(ctdb_get_ip_address) awk -v my_ip="$_ip_address" \ - '$1 == my_ip { if ($2 ~ "slave-only") { exit 0 } else { exit 1 } }' \ + '$1 == my_ip { if ($2 ~ "follower-only") { exit 0 } else { exit 1 } }' \ "$CTDB_LVS_NODES" } @@ -33,7 +33,7 @@ lvs_check_config () die "error: CTDB_LVS_NODES=${CTDB_LVS_NODES} unreadable" [ -n "$CTDB_LVS_PUBLIC_IP" ] || \ die "Invalid configuration: CTDB_LVS_PUBLIC_IP not set" - if ! lvs_slave_only ; then + if ! lvs_follower_only ; then [ -n "$CTDB_LVS_PUBLIC_IFACE" ] || \ die "Invalid configuration: CTDB_LVS_PUBLIC_IFACE not set" fi @@ -78,9 +78,9 @@ ipreallocated) "$CTDB_LVS_PUBLIC_IFACE" "$CTDB_LVS_PUBLIC_IP" pnn=$(ctdb_get_pnn) - lvsmaster=$("${CTDB_HELPER_BINDIR}/ctdb_lvs" master) - if [ "$pnn" != "$lvsmaster" ] ; then - # This node is not the LVS master so change the IP address + lvsleader=$("${CTDB_HELPER_BINDIR}/ctdb_lvs" leader) + if [ "$pnn" != "$lvsleader" ] ; then + # This node is not the LVS leader so change the IP address # to have scope "host" so this node won't respond to ARPs ip addr del "${CTDB_LVS_PUBLIC_IP}/32" dev lo >/dev/null 2>&1 ip addr add "${CTDB_LVS_PUBLIC_IP}/32" dev lo scope host diff --git a/ctdb/doc/ctdb-script.options.5.xml b/ctdb/doc/ctdb-script.options.5.xml index d46de369c5c..700d1f7bd35 100644 --- a/ctdb/doc/ctdb-script.options.5.xml +++ b/ctdb/doc/ctdb-script.options.5.xml @@ -451,7 +451,7 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000 File format: -IPADDR slave-only +IPADDR follower-only @@ -459,8 +459,8 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000 group. - If "slave-only" is specified then the corresponding node - can not be the LVS master node. In this case + If "follower-only" is specified then the corresponding node + can not be the LVS leader node. In this case CTDB_LVS_PUBLIC_IFACE and CTDB_LVS_PUBLIC_IP are optional and unused. @@ -480,7 +480,7 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000 INTERFACE is the network interface that clients will use to connection to CTDB_LVS_PUBLIC_IP. - This is optional for slave-only nodes. + This is optional for follower-only nodes. No default. diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml index 9b530087e92..217a6d3e41a 100644 --- a/ctdb/doc/ctdb.1.xml +++ b/ctdb/doc/ctdb.1.xml @@ -864,7 +864,7 @@ MonitorInterval = 15 - lvs {master|list|status} + lvs {leader|list|status} This command shows different aspects of LVS status. For an overview of CTDB's LVS functionality please see the @@ -875,10 +875,10 @@ MonitorInterval = 15 - master + leader - Shows the PNN of the current LVS master node. + Shows the PNN of the current LVS leader node. Example output: diff --git a/ctdb/doc/ctdb.7.xml b/ctdb/doc/ctdb.7.xml index 5ec69e4c871..7fd61af0964 100644 --- a/ctdb/doc/ctdb.7.xml +++ b/ctdb/doc/ctdb.7.xml @@ -528,13 +528,13 @@ Node 3:/usr/local/etc/ctdb/public_addresses In each LVS group, one of the nodes is selected by CTDB to be - the LVS master. This node receives all traffic from clients + the LVS leader. This node receives all traffic from clients coming in to the LVS public address and multiplexes it across the internal network to one of the nodes that LVS is using. When responding to the client, that node will send the data back - directly to the client, bypassing the LVS master node. The - command ctdb lvs master will show which node - is the current LVS master. + directly to the client, bypassing the LVS leader node. The + command ctdb lvs leader will show which node + is the current LVS leader. @@ -542,12 +542,12 @@ Node 3:/usr/local/etc/ctdb/public_addresses - Client sends request packet to LVSMASTER. + Client sends request packet to LVS leader. - LVSMASTER passes the request on to one node across the + LVS leader passes the request on to one node across the internal network. @@ -572,7 +572,7 @@ Node 3:/usr/local/etc/ctdb/public_addresses pattern is write-intensive since you will be limited in the available network bandwidth that node can handle. LVS does work very well for read-intensive workloads where only smallish READ - requests are going through the LVSMASTER bottleneck and the + requests are going through the LVS leader bottleneck and the majority of the traffic volume (the data in the read replies) goes straight from the processing node back to the clients. For read-intensive i/o patterns you can achieve very high throughput @@ -631,21 +631,21 @@ CTDB_LVS_NODES=/usr/local/etc/ctdb/lvs_nodes - Normally any node in an LVS group can act as the LVS master. + Normally any node in an LVS group can act as the LVS leader. Nodes that are highly loaded due to other demands maybe - flagged with the "slave-only" option in the + flagged with the "follower-only" option in the CTDB_LVS_NODES file to limit the LVS functionality of those nodes. LVS nodes file that excludes 192.168.1.4 from being - the LVS master node: + the LVS leader node: 192.168.1.2 192.168.1.3 -192.168.1.4 slave-only +192.168.1.4 follower-only diff --git a/ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.012.sh b/ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.012.sh index 970a4aa9ccf..15328efba97 100755 --- a/ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.012.sh +++ b/ctdb/tests/UNIT/eventscripts/91.lvs.ipreallocated.012.sh @@ -2,7 +2,7 @@ . "${TEST_SCRIPTS_DIR}/unit.sh" -define_test "nodes in config, no master (e.g. all inactive)" +define_test "nodes in config, no leader (e.g. all inactive)" setup "10.1.1.201" "eth0" <&2 <