From 3aa5f00e69343a44aa1eac599aed0117a5fa264c Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Thu, 19 Apr 2018 10:29:13 +0200 Subject: MDEV-15929 Fix lock wait timeout on `SELECT @@GLOBAL.WSREP_ON` This patch fixes a lock wait timeout error on `SELECT @@GLOBAL.WSREP_ON` in `wait_wsrep_ready.inc`: ``` --connection node_2 ... --source include/kill_galera.inc --connection node_1 --source include/wait_until_connected_again.inc # This includes wait_wsrep_ready.inc ``` The problem is that on node_2, kill_galera.inc may return before the node is killed. So node_1 may still see that node_1 is alive and will attempt to sync wait when doing those `SELECT` statements. But sync wait is doomed to fail given that node_1 is killed, hence the lock wait timeout. One possible fix is to disable wsrep_sync_wait before including wait_until_connected_again. However, it appears that including wait_until_connected_again is not necessary at all in node_1, so this patch removes it altogether. --- mysql-test/suite/galera/include/galera_st_kill_slave.inc | 1 - 1 file changed, 1 deletion(-) (limited to 'mysql-test/suite/galera/include') diff --git a/mysql-test/suite/galera/include/galera_st_kill_slave.inc b/mysql-test/suite/galera/include/galera_st_kill_slave.inc index bae37755c65..ecdf08726a0 100644 --- a/mysql-test/suite/galera/include/galera_st_kill_slave.inc +++ b/mysql-test/suite/galera/include/galera_st_kill_slave.inc @@ -24,7 +24,6 @@ COMMIT; --source include/kill_galera.inc --connection node_1 ---source include/wait_until_connected_again.inc --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' --source include/wait_condition.inc -- cgit v1.2.1 From 9e5671f1cc190f9b9498eafcf858460a56ff3a38 Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Fri, 20 Apr 2018 14:44:27 +0200 Subject: MDEV-15948 Fix error "Lost connection to MySQL server..." in test galera_sst_mysqldump Test galera_sst_mysqldump often fails with error "2013: Lost connection to MySQL server during query". The connection is lost after the test restart one of the nodes. This happens because the server closes client connections if it is joining a cluster through SST method mysqldump. On unlucky runs of the test it is possible that mysqld is restarted, and then mtr client is disconnected while it tries to determine if galera is ready before going on with the test. This patch rewrites galera_wait_ready.inc so that it is immune to being disconnected. --- mysql-test/suite/galera/include/galera_load_provider.inc | 4 +--- mysql-test/suite/galera/include/start_mysqld.inc | 9 +-------- 2 files changed, 2 insertions(+), 11 deletions(-) (limited to 'mysql-test/suite/galera/include') diff --git a/mysql-test/suite/galera/include/galera_load_provider.inc b/mysql-test/suite/galera/include/galera_load_provider.inc index 761a1a89fd3..aeab7e6ea19 100644 --- a/mysql-test/suite/galera/include/galera_load_provider.inc +++ b/mysql-test/suite/galera/include/galera_load_provider.inc @@ -5,6 +5,4 @@ --eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'; --enable_query_log ---enable_reconnect ---source include/wait_until_connected_again.inc ---source include/wait_until_ready.inc +--source include/galera_wait_ready.inc diff --git a/mysql-test/suite/galera/include/start_mysqld.inc b/mysql-test/suite/galera/include/start_mysqld.inc index 4ee3d17810c..57af9203d0f 100644 --- a/mysql-test/suite/galera/include/start_mysqld.inc +++ b/mysql-test/suite/galera/include/start_mysqld.inc @@ -12,11 +12,4 @@ if ($galera_wsrep_start_position == '') { --exec echo "restart:$start_mysqld_params" > $_expect_file_name } -# Turn on reconnect ---enable_reconnect - -# Call script that will poll the server waiting for it to be back online again ---source include/wait_until_connected_again.inc - -# Turn off reconnect again ---disable_reconnect +--source include/galera_wait_ready.inc -- cgit v1.2.1 From 63e5307afd12f592688c98a449054ee29e2e1422 Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Mon, 23 Apr 2018 12:00:49 +0200 Subject: MDEV-15948 Followup commit * Increased timeout counter in galera_wait_ready.inc * Replaced useless include/wait_until_ready.inc after start_mysqld.inc in galera_st_*.inc with wait_condition on cluster size. --- mysql-test/suite/galera/include/galera_st_clean_slave.inc | 4 +++- mysql-test/suite/galera/include/galera_st_kill_slave.inc | 4 +++- mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc | 4 +++- mysql-test/suite/galera/include/galera_st_shutdown_slave.inc | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) (limited to 'mysql-test/suite/galera/include') diff --git a/mysql-test/suite/galera/include/galera_st_clean_slave.inc b/mysql-test/suite/galera/include/galera_st_clean_slave.inc index 81ba54aa6f5..3a49f4f6ad2 100644 --- a/mysql-test/suite/galera/include/galera_st_clean_slave.inc +++ b/mysql-test/suite/galera/include/galera_st_clean_slave.inc @@ -64,7 +64,9 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); --connection node_2 --echo Starting server ... --source include/start_mysqld.inc ---source include/wait_until_ready.inc + +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc SET AUTOCOMMIT=OFF; START TRANSACTION; diff --git a/mysql-test/suite/galera/include/galera_st_kill_slave.inc b/mysql-test/suite/galera/include/galera_st_kill_slave.inc index bae37755c65..534d7b64af7 100644 --- a/mysql-test/suite/galera/include/galera_st_kill_slave.inc +++ b/mysql-test/suite/galera/include/galera_st_kill_slave.inc @@ -59,7 +59,9 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); --echo Starting server ... --source include/start_mysqld.inc ---source include/wait_until_ready.inc + +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc SET AUTOCOMMIT=OFF; START TRANSACTION; diff --git a/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc b/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc index 72e80505870..44a1513fa6e 100644 --- a/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc +++ b/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc @@ -72,7 +72,9 @@ INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); --connection node_2 --echo Starting server ... --source include/start_mysqld.inc ---source include/wait_until_ready.inc + +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc SET AUTOCOMMIT=OFF; START TRANSACTION; diff --git a/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc b/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc index 1a65ef1bd94..6c09b0ceb0c 100644 --- a/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc +++ b/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc @@ -56,7 +56,9 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); --connection node_2 --echo Starting server ... --source include/start_mysqld.inc ---source include/wait_until_ready.inc + +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc SET AUTOCOMMIT=OFF; START TRANSACTION; -- cgit v1.2.1