Commit 3f5b03c4 authored by Julius Goryavsky's avatar Julius Goryavsky

MDEV-21905: Galera test galera_var_notify_cmd causes hang

The problem is related to performing operations without switching
wsrep off, this commit fixes this and allows disabled tests.
parent 34163154
...@@ -34,8 +34,10 @@ SCHEMA="mtr_wsrep_notify" ...@@ -34,8 +34,10 @@ SCHEMA="mtr_wsrep_notify"
MEMB_TABLE="$SCHEMA.membership" MEMB_TABLE="$SCHEMA.membership"
STATUS_TABLE="$SCHEMA.status" STATUS_TABLE="$SCHEMA.status"
BEGIN=" WSREP_ON='SET wsrep_on=ON'
SET wsrep_on=0; WSREP_OFF='SET wsrep_on=OFF'
BEGIN="$WSREP_OFF;
CREATE SCHEMA IF NOT EXISTS $SCHEMA; CREATE SCHEMA IF NOT EXISTS $SCHEMA;
CREATE TABLE IF NOT EXISTS $MEMB_TABLE ( CREATE TABLE IF NOT EXISTS $MEMB_TABLE (
idx INT, idx INT,
...@@ -50,9 +52,8 @@ CREATE TABLE IF NOT EXISTS $STATUS_TABLE ( ...@@ -50,9 +52,8 @@ CREATE TABLE IF NOT EXISTS $STATUS_TABLE (
uuid CHAR(40), /* cluster UUID */ uuid CHAR(40), /* cluster UUID */
prim BOOLEAN /* if component is primary */ prim BOOLEAN /* if component is primary */
) ENGINE=MEMORY; ) ENGINE=MEMORY;
BEGIN; BEGIN"
" END="COMMIT; $WSREP_ON"
END="COMMIT;"
configuration_change() configuration_change()
{ {
...@@ -71,7 +72,7 @@ configuration_change() ...@@ -71,7 +72,7 @@ configuration_change()
echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);" echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);"
echo "$END" echo "$END;"
} }
status_update() status_update()
...@@ -186,13 +187,13 @@ then ...@@ -186,13 +187,13 @@ then
fi fi
fi fi
case $STATUS in case "$STATUS" in
"joined" | "donor" | "synced") 'joined' | 'donor' | 'synced')
"$COM" | eval "$CLIENT" -B "-u'$USER'"${PSWD:+" -p'$PSWD'"}\ "$COM" | eval "$CLIENT" -B "-u'$USER'"${PSWD:+" -p'$PSWD'"}\
"-h'$HOST'" "-P$PORT"$SSL_PARAM "-h'$HOST'" "-P$PORT"$SSL_PARAM
;; ;;
*) *)
# The node might be shutting down # The node might be shutting down or not initialized
;; ;;
esac esac
......
...@@ -34,8 +34,10 @@ SCHEMA="mtr_wsrep_notify" ...@@ -34,8 +34,10 @@ SCHEMA="mtr_wsrep_notify"
MEMB_TABLE="$SCHEMA.membership" MEMB_TABLE="$SCHEMA.membership"
STATUS_TABLE="$SCHEMA.status" STATUS_TABLE="$SCHEMA.status"
BEGIN=" WSREP_ON='SET wsrep_on=ON'
SET wsrep_on=0; WSREP_OFF='SET wsrep_on=OFF'
BEGIN="$WSREP_OFF;
CREATE SCHEMA IF NOT EXISTS $SCHEMA; CREATE SCHEMA IF NOT EXISTS $SCHEMA;
CREATE TABLE IF NOT EXISTS $MEMB_TABLE ( CREATE TABLE IF NOT EXISTS $MEMB_TABLE (
idx INT, idx INT,
...@@ -50,9 +52,8 @@ CREATE TABLE IF NOT EXISTS $STATUS_TABLE ( ...@@ -50,9 +52,8 @@ CREATE TABLE IF NOT EXISTS $STATUS_TABLE (
uuid CHAR(40), /* cluster UUID */ uuid CHAR(40), /* cluster UUID */
prim BOOLEAN /* if component is primary */ prim BOOLEAN /* if component is primary */
) ENGINE=MEMORY; ) ENGINE=MEMORY;
BEGIN; BEGIN"
" END="COMMIT; $WSREP_ON"
END="COMMIT;"
configuration_change() configuration_change()
{ {
...@@ -71,12 +72,12 @@ configuration_change() ...@@ -71,12 +72,12 @@ configuration_change()
echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);" echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);"
echo "$END" echo "$END;"
} }
status_update() status_update()
{ {
echo "SET wsrep_on=0; BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; COMMIT;" echo "$BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; $END;"
} }
trim_string() trim_string()
...@@ -186,10 +187,14 @@ then ...@@ -186,10 +187,14 @@ then
fi fi
fi fi
# Undefined means node is shutting down case "$STATUS" in
if [ "$STATUS" != 'Undefined' ]; then 'joined' | 'donor' | 'synced')
"$COM" | eval "$CLIENT" -B "-u'$USER'"${PSWD:+" -p'$PSWD'"}\ "$COM" | eval "$CLIENT" -B "-u'$USER'"${PSWD:+" -p'$PSWD'"}\
"-h'$HOST'" "-P$PORT"$SSL_PARAM "-h'$HOST'" "-P$PORT"$SSL_PARAM
fi ;;
*)
# The node might be shutting down or not initialized
;;
esac
exit 0 exit 0
...@@ -23,11 +23,8 @@ galera_pc_recovery : MDEV-25199 cluster fails to start up ...@@ -23,11 +23,8 @@ galera_pc_recovery : MDEV-25199 cluster fails to start up
galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim
galera_var_ignore_apply_errors : MDEV-26770 galera_var_ignore_apply_errors fails Server did not transition to READY state galera_var_ignore_apply_errors : MDEV-26770 galera_var_ignore_apply_errors fails Server did not transition to READY state
galera_var_node_address : MDEV-20485 Galera test failure galera_var_node_address : MDEV-20485 Galera test failure
galera_var_notify_cmd : MDEV-21905 Galera test galera_var_notify_cmd causes hang
galera_var_notify_ssl_ipv6 : hangs after the merge of MDEV-27682
galera_var_retry_autocommit: MDEV-18181 Galera test failure on galera.galera_var_retry_autocommit galera_var_retry_autocommit: MDEV-18181 Galera test failure on galera.galera_var_retry_autocommit
partition : MDEV-19958 Galera test failure on galera.partition partition : MDEV-19958 Galera test failure on galera.partition
query_cache: MDEV-15805 Test failure on galera.query_cache query_cache: MDEV-15805 Test failure on galera.query_cache
versioning_trx_id: MDEV-18590: galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch versioning_trx_id: MDEV-18590: galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch
galera_bf_abort_at_after_statement : Unstable galera_bf_abort_at_after_statement : Unstable
connection node_2;
connection node_1;
connection node_1; connection node_1;
SELECT COUNT(DISTINCT uuid) AS EXPECT_2 FROM mtr_wsrep_notify.membership; SELECT COUNT(DISTINCT uuid) AS EXPECT_2 FROM mtr_wsrep_notify.membership;
EXPECT_2 EXPECT_2
......
...@@ -34,8 +34,10 @@ SCHEMA="wsrep" ...@@ -34,8 +34,10 @@ SCHEMA="wsrep"
MEMB_TABLE="$SCHEMA.membership" MEMB_TABLE="$SCHEMA.membership"
STATUS_TABLE="$SCHEMA.status" STATUS_TABLE="$SCHEMA.status"
BEGIN=" WSREP_ON='SET wsrep_on=ON'
SET wsrep_on=0; WSREP_OFF='SET wsrep_on=OFF'
BEGIN="$WSREP_OFF;
DROP SCHEMA IF EXISTS $SCHEMA; CREATE SCHEMA $SCHEMA; DROP SCHEMA IF EXISTS $SCHEMA; CREATE SCHEMA $SCHEMA;
CREATE TABLE $MEMB_TABLE ( CREATE TABLE $MEMB_TABLE (
idx INT UNIQUE PRIMARY KEY, idx INT UNIQUE PRIMARY KEY,
...@@ -50,9 +52,8 @@ CREATE TABLE $STATUS_TABLE ( ...@@ -50,9 +52,8 @@ CREATE TABLE $STATUS_TABLE (
uuid CHAR(40), /* cluster UUID */ uuid CHAR(40), /* cluster UUID */
prim BOOLEAN /* if component is primary */ prim BOOLEAN /* if component is primary */
) ENGINE=MEMORY; ) ENGINE=MEMORY;
BEGIN; BEGIN"
" END="COMMIT; $WSREP_ON"
END="COMMIT;"
configuration_change() configuration_change()
{ {
...@@ -71,12 +72,12 @@ configuration_change() ...@@ -71,12 +72,12 @@ configuration_change()
echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);" echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);"
echo "$END" echo "$END;"
} }
status_update() status_update()
{ {
echo "SET wsrep_on=0; BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; COMMIT;" echo "$WSREP_OFF; BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; $END;"
} }
trim_string() trim_string()
...@@ -186,10 +187,14 @@ then ...@@ -186,10 +187,14 @@ then
fi fi
fi fi
# Undefined means node is shutting down case "$STATUS" in
if [ "$STATUS" != 'Undefined' ]; then 'joined' | 'donor' | 'synced')
"$COM" | eval "$CLIENT" -B "-u'$USER'"${PSWD:+" -p'$PSWD'"}\ "$COM" | eval "$CLIENT" -B "-u'$USER'"${PSWD:+" -p'$PSWD'"}\
"-h'$HOST'" "-P$PORT"$SSL_PARAM "-h'$HOST'" "-P$PORT"$SSL_PARAM
fi ;;
*)
# The node might be shutting down or not initialized
;;
esac
exit 0 exit 0
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