Commit 8f309732 authored by Julius Goryavsky's avatar Julius Goryavsky

MDEV-29814: galera_var_notify_ssl_ipv6 causes testing system to hang

This commit fixes the test system hanging due to
the galera_var_notify_ssl_ipv6 test and also brings
the wsrep_notify[_ssl].sh files in line with each other
between the user template and the mtr suite.

Quotes are also added here to avoid problems if the
user specifies the value of one of the variables at the
beginning of the file containing shell-specific characters,
for example, if the password or username specified in the
PSWD and USER variables will contain the "$" character.

Also fixed an issue with automatic --ssl-verify-server-cert
option substitution when the corresponding value is set
by the user to "1" or "on".

Also fixed some tests here to avoid joining one of the nodes
to another cluster when the nodes are restarted from the mtr
side, which can lead to random failures when testing with
buildbot.
parent 782b2a75
...@@ -6,30 +6,32 @@ ...@@ -6,30 +6,32 @@
# #
# Edit parameters below to specify the address and login to server: # Edit parameters below to specify the address and login to server:
# #
USER=root USER='root'
PSWD= PSWD=''
# #
# If these parameters are not set, then the values # If these parameters are not set, then the values
# passed by the server are taken: # passed by the server are taken:
# #
HOST=127.0.0.1 HOST="127.0.0.1"
PORT=$NODE_MYPORT_1 PORT=$NODE_MYPORT_1
# #
# Edit parameters below to specify SSL parameters: # Edit parameters below to specify SSL parameters:
# #
ssl_key= ssl_cert=""
ssl_cert= ssl_key=""
ssl_ca= ssl_ca=""
ssl_capath= ssl_capath=""
ssl_cipher= ssl_cipher=""
ssl_crl= ssl_crl=""
ssl_crlpath= ssl_crlpath=""
ssl_verify_server_cert=0 ssl_verify_server_cert=0
# #
# Client executable path: # Client executable path:
# #
CLIENT="$EXE_MYSQL" CLIENT="$EXE_MYSQL"
#
# Name of schema and tables:
#
SCHEMA="mtr_wsrep_notify" SCHEMA="mtr_wsrep_notify"
MEMB_TABLE="$SCHEMA.membership" MEMB_TABLE="$SCHEMA.membership"
STATUS_TABLE="$SCHEMA.status" STATUS_TABLE="$SCHEMA.status"
...@@ -65,9 +67,9 @@ configuration_change() ...@@ -65,9 +67,9 @@ configuration_change()
do do
echo "INSERT INTO $MEMB_TABLE VALUES ( $idx, " echo "INSERT INTO $MEMB_TABLE VALUES ( $idx, "
# Don't forget to properly quote string values # Don't forget to properly quote string values
echo "'$NODE'" | sed s/\\//\',\'/g echo "'$NODE'" | sed s/\\//\',\'/g
echo ");" echo ");"
idx=$(( $idx + 1 )) idx=$(( $idx+1 ))
done done
echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);" echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);"
...@@ -102,34 +104,35 @@ trim_string() ...@@ -102,34 +104,35 @@ trim_string()
fi fi
} }
COM=status_update # not a configuration change by default COM='status_update' # not a configuration change by default
STATUS="" STATUS=""
CLUSTER_UUID="" CLUSTER_UUID=""
PRIMARY="0" PRIMARY=0
INDEX="" INDEX=""
MEMBERS="" MEMBERS=""
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case $1 in case $1 in
--status) '--status')
STATUS=$(trim_string "$2") STATUS=$(trim_string "$2")
shift shift
;; ;;
--uuid) '--uuid')
CLUSTER_UUID=$(trim_string "$2") CLUSTER_UUID=$(trim_string "$2")
shift shift
;; ;;
--primary) '--primary')
[ "$2" = "yes" ] && PRIMARY="1" || PRIMARY="0" arg=$(trim_string "$2")
COM=configuration_change [ "$arg" = 'yes' ] && PRIMARY=1 || PRIMARY=0
COM='configuration_change'
shift shift
;; ;;
--index) '--index')
INDEX=$(trim_string "$2") INDEX=$(trim_string "$2")
shift shift
;; ;;
--members) '--members')
MEMBERS=$(trim_string "$2") MEMBERS=$(trim_string "$2")
shift shift
;; ;;
...@@ -168,9 +171,7 @@ ssl_verify_server_cert=$(trim_string "$ssl_verify_server_cert"); ...@@ -168,9 +171,7 @@ ssl_verify_server_cert=$(trim_string "$ssl_verify_server_cert");
SSL_PARAM="" SSL_PARAM=""
if [ -n "$ssl_key" -o -n "$ssl_cert" -o \ if [ -n "$ssl_key$ssl_cert$ssl_ca$ssl_capath$ssl_cipher$ssl_crl$ssl_crlpath" ]
-n "$ssl_ca" -o -n "$ssl_capath" -o \
-n "$ssl_cipher" ]
then then
SSL_PARAM=' --ssl' SSL_PARAM=' --ssl'
[ -n "$ssl_key" ] && SSL_PARAM="$SSL_PARAM --ssl-key='$ssl_key'" [ -n "$ssl_key" ] && SSL_PARAM="$SSL_PARAM --ssl-key='$ssl_key'"
...@@ -181,8 +182,10 @@ then ...@@ -181,8 +182,10 @@ then
[ -n "$ssl_crl" ] && SSL_PARAM="$SSL_PARAM --ssl-crl='$ssl_crl'" [ -n "$ssl_crl" ] && SSL_PARAM="$SSL_PARAM --ssl-crl='$ssl_crl'"
[ -n "$ssl_crlpath" ] && SSL_PARAM="$SSL_PARAM --ssl-crlpath='$ssl_crlpath'" [ -n "$ssl_crlpath" ] && SSL_PARAM="$SSL_PARAM --ssl-crlpath='$ssl_crlpath'"
if [ -n "$ssl_verify_server_cert" ]; then if [ -n "$ssl_verify_server_cert" ]; then
if [ $ssl_verify_server_cert -ne 0 ]; then if [ "$ssl_verify_server_cert" != "0" -o \
SSL_PARAM+=' --ssl-verify-server-cert' "$ssl_verify_server_cert" = "on" ]
then
SSL_PARAM="$SSL_PARAM --ssl-verify-server-cert"
fi fi
fi fi
fi fi
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
# #
# Edit parameters below to specify the address and login to server: # Edit parameters below to specify the address and login to server:
# #
USER=root USER='root'
PSWD= PSWD=''
# #
# If these parameters are not set, then the values # If these parameters are not set, then the values
# passed by the server are taken: # passed by the server are taken:
# #
HOST=127.0.0.1 HOST="127.0.0.1"
PORT=$NODE_MYPORT_1 PORT=$NODE_MYPORT_1
# #
# Edit parameters below to specify SSL parameters: # Edit parameters below to specify SSL parameters:
...@@ -20,16 +20,18 @@ PORT=$NODE_MYPORT_1 ...@@ -20,16 +20,18 @@ PORT=$NODE_MYPORT_1
ssl_cert="$MYSQL_TEST_DIR/std_data/client-cert.pem" ssl_cert="$MYSQL_TEST_DIR/std_data/client-cert.pem"
ssl_key="$MYSQL_TEST_DIR/std_data/client-key.pem" ssl_key="$MYSQL_TEST_DIR/std_data/client-key.pem"
ssl_ca="$MYSQL_TEST_DIR/std_data/cacert.pem" ssl_ca="$MYSQL_TEST_DIR/std_data/cacert.pem"
ssl_capath= ssl_capath=""
ssl_cipher= ssl_cipher=""
ssl_crl= ssl_crl=""
ssl_crlpath= ssl_crlpath=""
ssl_verify_server_cert=0 ssl_verify_server_cert=0
# #
# Client executable path: # Client executable path:
# #
CLIENT="$EXE_MYSQL" CLIENT="$EXE_MYSQL"
#
# Name of schema and tables:
#
SCHEMA="mtr_wsrep_notify" SCHEMA="mtr_wsrep_notify"
MEMB_TABLE="$SCHEMA.membership" MEMB_TABLE="$SCHEMA.membership"
STATUS_TABLE="$SCHEMA.status" STATUS_TABLE="$SCHEMA.status"
...@@ -65,9 +67,9 @@ configuration_change() ...@@ -65,9 +67,9 @@ configuration_change()
do do
echo "INSERT INTO $MEMB_TABLE VALUES ( $idx, " echo "INSERT INTO $MEMB_TABLE VALUES ( $idx, "
# Don't forget to properly quote string values # Don't forget to properly quote string values
echo "'$NODE'" | sed s/\\//\',\'/g echo "'$NODE'" | sed s/\\//\',\'/g
echo ");" echo ");"
idx=$(( $idx + 1 )) idx=$(( $idx+1 ))
done done
echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);" echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);"
...@@ -102,34 +104,35 @@ trim_string() ...@@ -102,34 +104,35 @@ trim_string()
fi fi
} }
COM=status_update # not a configuration change by default COM='status_update' # not a configuration change by default
STATUS="" STATUS=""
CLUSTER_UUID="" CLUSTER_UUID=""
PRIMARY="0" PRIMARY=0
INDEX="" INDEX=""
MEMBERS="" MEMBERS=""
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case $1 in case $1 in
--status) '--status')
STATUS=$(trim_string "$2") STATUS=$(trim_string "$2")
shift shift
;; ;;
--uuid) '--uuid')
CLUSTER_UUID=$(trim_string "$2") CLUSTER_UUID=$(trim_string "$2")
shift shift
;; ;;
--primary) '--primary')
[ "$2" = "yes" ] && PRIMARY="1" || PRIMARY="0" arg=$(trim_string "$2")
COM=configuration_change [ "$arg" = 'yes' ] && PRIMARY=1 || PRIMARY=0
COM='configuration_change'
shift shift
;; ;;
--index) '--index')
INDEX=$(trim_string "$2") INDEX=$(trim_string "$2")
shift shift
;; ;;
--members) '--members')
MEMBERS=$(trim_string "$2") MEMBERS=$(trim_string "$2")
shift shift
;; ;;
...@@ -168,9 +171,7 @@ ssl_verify_server_cert=$(trim_string "$ssl_verify_server_cert"); ...@@ -168,9 +171,7 @@ ssl_verify_server_cert=$(trim_string "$ssl_verify_server_cert");
SSL_PARAM="" SSL_PARAM=""
if [ -n "$ssl_key" -o -n "$ssl_cert" -o \ if [ -n "$ssl_key$ssl_cert$ssl_ca$ssl_capath$ssl_cipher$ssl_crl$ssl_crlpath" ]
-n "$ssl_ca" -o -n "$ssl_capath" -o \
-n "$ssl_cipher" ]
then then
SSL_PARAM=' --ssl' SSL_PARAM=' --ssl'
[ -n "$ssl_key" ] && SSL_PARAM="$SSL_PARAM --ssl-key='$ssl_key'" [ -n "$ssl_key" ] && SSL_PARAM="$SSL_PARAM --ssl-key='$ssl_key'"
...@@ -181,8 +182,10 @@ then ...@@ -181,8 +182,10 @@ then
[ -n "$ssl_crl" ] && SSL_PARAM="$SSL_PARAM --ssl-crl='$ssl_crl'" [ -n "$ssl_crl" ] && SSL_PARAM="$SSL_PARAM --ssl-crl='$ssl_crl'"
[ -n "$ssl_crlpath" ] && SSL_PARAM="$SSL_PARAM --ssl-crlpath='$ssl_crlpath'" [ -n "$ssl_crlpath" ] && SSL_PARAM="$SSL_PARAM --ssl-crlpath='$ssl_crlpath'"
if [ -n "$ssl_verify_server_cert" ]; then if [ -n "$ssl_verify_server_cert" ]; then
if [ $ssl_verify_server_cert -ne 0 ]; then if [ "$ssl_verify_server_cert" != "0" -o \
SSL_PARAM+=' --ssl-verify-server-cert' "$ssl_verify_server_cert" = "on" ]
then
SSL_PARAM="$SSL_PARAM --ssl-verify-server-cert"
fi fi
fi fi
fi fi
......
connection node_1; connection node_1;
connection node_2;
connection node_2;
Shutting down server ...
connection node_1;
connection node_2;
Cleaning grastate.dat file ...
Starting server ...
connection node_1;
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE VARIABLE_VALUE
Primary Primary
...@@ -36,3 +44,7 @@ VARIABLE_VALUE ...@@ -36,3 +44,7 @@ VARIABLE_VALUE
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
VARIABLE_VALUE VARIABLE_VALUE
Synced Synced
Shutting down server ...
Cleaning var directory ...
Starting server ...
connection node_1;
...@@ -7,14 +7,14 @@ ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem ...@@ -7,14 +7,14 @@ ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem
bind-address=:: bind-address=::
[mysqld.1] [mysqld.1]
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port;gcache.size=1;pc.ignore_sb=true' wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port;repl.causal_read_timeout=PT90S;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M'
wsrep_node_incoming_address='[::1]:@mysqld.1.port' wsrep_node_incoming_address='[::1]:@mysqld.1.port'
wsrep_node_address=::1 wsrep_node_address=[::1]:@mysqld.1.#galera_port
wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port' wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
[mysqld.2] [mysqld.2]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port;gcache.size=1;pc.ignore_sb=true' wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port;repl.causal_read_timeout=PT90S;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M'
wsrep_node_address=::1
wsrep_node_incoming_address='[::1]:@mysqld.2.port' wsrep_node_incoming_address='[::1]:@mysqld.2.port'
wsrep_node_address=[::1]:@mysqld.2.#galera_port
wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port' wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
...@@ -7,6 +7,34 @@ ...@@ -7,6 +7,34 @@
--source include/galera_cluster.inc --source include/galera_cluster.inc
--source include/have_innodb.inc --source include/have_innodb.inc
# Save original auto_increment_offset values.
--let $node_1=node_1
--let $node_2=node_2
--source include/auto_increment_offset_save.inc
--connection node_2
--echo Shutting down server ...
--source include/shutdown_mysqld.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
--connection node_2
#
# Delete grastate.dat with safe_to_bootstrap: 0
#
--echo Cleaning grastate.dat file ...
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--echo Starting server ...
--let $restart_noprint=2
--let $start_mysqld_params="--wsrep-new-cluster"
--source include/start_mysqld.inc
--source include/wait_until_ready.inc
--connection node_1 --connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; --let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
...@@ -38,3 +66,29 @@ SELECT (VARIABLE_VALUE = 0 OR VARIABLE_VALUE = 1 ) FROM INFORMATION_SCHEMA.GLOBA ...@@ -38,3 +66,29 @@ SELECT (VARIABLE_VALUE = 0 OR VARIABLE_VALUE = 1 ) FROM INFORMATION_SCHEMA.GLOBA
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
--echo Shutting down server ...
--source include/shutdown_mysqld.inc
#
# Force SST
#
--echo Cleaning var directory ...
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mtr
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/performance_schema
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/test
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mysql
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data
--echo Starting server ...
--let $start_mysqld_params=
--source include/start_mysqld.inc
--source include/wait_until_ready.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
--source include/auto_increment_offset_restore.inc
...@@ -6,30 +6,32 @@ ...@@ -6,30 +6,32 @@
# #
# Edit parameters below to specify the address and login to server: # Edit parameters below to specify the address and login to server:
# #
USER=root USER='root'
PSWD=rootpass PSWD='rootpass'
# #
# If these parameters are not set, then the values # If these parameters are not set, then the values
# passed by the server are taken: # passed by the server are taken:
# #
HOST=127.0.0.1 HOST="127.0.0.1"
PORT=3306 PORT=3306
# #
# Edit parameters below to specify SSL parameters: # Edit parameters below to specify SSL parameters:
# #
ssl_key= ssl_cert=""
ssl_cert= ssl_key=""
ssl_ca= ssl_ca=""
ssl_capath= ssl_capath=""
ssl_cipher= ssl_cipher=""
ssl_crl= ssl_crl=""
ssl_crlpath= ssl_crlpath=""
ssl_verify_server_cert=0 ssl_verify_server_cert=0
# #
# Client executable path: # Client executable path:
# #
CLIENT="mysql" CLIENT="mysql"
#
# Name of schema and tables:
#
SCHEMA="wsrep" SCHEMA="wsrep"
MEMB_TABLE="$SCHEMA.membership" MEMB_TABLE="$SCHEMA.membership"
STATUS_TABLE="$SCHEMA.status" STATUS_TABLE="$SCHEMA.status"
...@@ -37,15 +39,14 @@ STATUS_TABLE="$SCHEMA.status" ...@@ -37,15 +39,14 @@ STATUS_TABLE="$SCHEMA.status"
WSREP_ON='SET wsrep_on=ON' WSREP_ON='SET wsrep_on=ON'
WSREP_OFF='SET wsrep_on=OFF' WSREP_OFF='SET wsrep_on=OFF'
BEGIN="$WSREP_OFF; BEGIN="CREATE SCHEMA IF NOT EXISTS $SCHEMA;
DROP SCHEMA IF EXISTS $SCHEMA; CREATE SCHEMA $SCHEMA; CREATE TABLE IF NOT EXISTS $MEMB_TABLE (
CREATE TABLE $MEMB_TABLE (
idx INT UNIQUE PRIMARY KEY, idx INT UNIQUE PRIMARY KEY,
uuid CHAR(40) UNIQUE, /* node UUID */ uuid CHAR(40) UNIQUE, /* node UUID */
name VARCHAR(32), /* node name */ name VARCHAR(32), /* node name */
addr VARCHAR(256) /* node address */ addr VARCHAR(256) /* node address */
) ENGINE=MEMORY; ) ENGINE=MEMORY;
CREATE TABLE $STATUS_TABLE ( CREATE TABLE IF NOT EXISTS $STATUS_TABLE (
size INT, /* component size */ size INT, /* component size */
idx INT, /* this node index */ idx INT, /* this node index */
status CHAR(16), /* this node status */ status CHAR(16), /* this node status */
...@@ -57,7 +58,7 @@ END="COMMIT; $WSREP_ON" ...@@ -57,7 +58,7 @@ END="COMMIT; $WSREP_ON"
configuration_change() configuration_change()
{ {
echo "$BEGIN;" echo "$WSREP_OFF; DROP SCHEMA IF EXISTS $SCHEMA; $BEGIN;"
local idx=0 local idx=0
...@@ -67,7 +68,7 @@ configuration_change() ...@@ -67,7 +68,7 @@ configuration_change()
# Don't forget to properly quote string values # Don't forget to properly quote string values
echo "'$NODE'" | sed s/\\//\',\'/g echo "'$NODE'" | sed s/\\//\',\'/g
echo ");" echo ");"
idx=$(( $idx + 1 )) idx=$(( $idx+1 ))
done done
echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);" echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);"
...@@ -77,7 +78,7 @@ configuration_change() ...@@ -77,7 +78,7 @@ configuration_change()
status_update() status_update()
{ {
echo "$WSREP_OFF; BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; $END;" echo "$WSREP_OFF; $BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; $END;"
} }
trim_string() trim_string()
...@@ -102,34 +103,35 @@ trim_string() ...@@ -102,34 +103,35 @@ trim_string()
fi fi
} }
COM=status_update # not a configuration change by default COM='status_update' # not a configuration change by default
STATUS="" STATUS=""
CLUSTER_UUID="" CLUSTER_UUID=""
PRIMARY="0" PRIMARY=0
INDEX="" INDEX=""
MEMBERS="" MEMBERS=""
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case $1 in case $1 in
--status) '--status')
STATUS=$(trim_string "$2") STATUS=$(trim_string "$2")
shift shift
;; ;;
--uuid) '--uuid')
CLUSTER_UUID=$(trim_string "$2") CLUSTER_UUID=$(trim_string "$2")
shift shift
;; ;;
--primary) '--primary')
[ "$2" = "yes" ] && PRIMARY="1" || PRIMARY="0" arg=$(trim_string "$2")
COM=configuration_change [ "$arg" = 'yes' ] && PRIMARY=1 || PRIMARY=0
COM='configuration_change'
shift shift
;; ;;
--index) '--index')
INDEX=$(trim_string "$2") INDEX=$(trim_string "$2")
shift shift
;; ;;
--members) '--members')
MEMBERS=$(trim_string "$2") MEMBERS=$(trim_string "$2")
shift shift
;; ;;
...@@ -168,9 +170,7 @@ ssl_verify_server_cert=$(trim_string "$ssl_verify_server_cert"); ...@@ -168,9 +170,7 @@ ssl_verify_server_cert=$(trim_string "$ssl_verify_server_cert");
SSL_PARAM="" SSL_PARAM=""
if [ -n "$ssl_key" -o -n "$ssl_cert" -o \ if [ -n "$ssl_key$ssl_cert$ssl_ca$ssl_capath$ssl_cipher$ssl_crl$ssl_crlpath" ]
-n "$ssl_ca" -o -n "$ssl_capath" -o \
-n "$ssl_cipher" ]
then then
SSL_PARAM=' --ssl' SSL_PARAM=' --ssl'
[ -n "$ssl_key" ] && SSL_PARAM="$SSL_PARAM --ssl-key='$ssl_key'" [ -n "$ssl_key" ] && SSL_PARAM="$SSL_PARAM --ssl-key='$ssl_key'"
...@@ -181,8 +181,10 @@ then ...@@ -181,8 +181,10 @@ then
[ -n "$ssl_crl" ] && SSL_PARAM="$SSL_PARAM --ssl-crl='$ssl_crl'" [ -n "$ssl_crl" ] && SSL_PARAM="$SSL_PARAM --ssl-crl='$ssl_crl'"
[ -n "$ssl_crlpath" ] && SSL_PARAM="$SSL_PARAM --ssl-crlpath='$ssl_crlpath'" [ -n "$ssl_crlpath" ] && SSL_PARAM="$SSL_PARAM --ssl-crlpath='$ssl_crlpath'"
if [ -n "$ssl_verify_server_cert" ]; then if [ -n "$ssl_verify_server_cert" ]; then
if [ $ssl_verify_server_cert -ne 0 ]; then if [ "$ssl_verify_server_cert" != "0" -o \
SSL_PARAM+=' --ssl-verify-server-cert' "$ssl_verify_server_cert" = "on" ]
then
SSL_PARAM="$SSL_PARAM --ssl-verify-server-cert"
fi fi
fi fi
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment