From f6618d6975d3a9f43337bce1efc927a2eaeb033a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 29 Jan 2025 20:08:41 +0200 Subject: [PATCH] MDEV-35951 : Complete freeze during MW-329 test Rewrite test not to use infinite procedure, it is not necessary to test. --- mysql-test/suite/galera/r/MW-329.result | 9 ++++++--- mysql-test/suite/galera/t/MW-329.test | 25 ++++++++++++------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/mysql-test/suite/galera/r/MW-329.result b/mysql-test/suite/galera/r/MW-329.result index 16afcc1599639..bdde55cba6329 100644 --- a/mysql-test/suite/galera/r/MW-329.result +++ b/mysql-test/suite/galera/r/MW-329.result @@ -2,21 +2,24 @@ connection node_2; connection node_1; CREATE TABLE t1 (f1 INTEGER, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB; INSERT INTO t1 (f1) VALUES (1),(65535); -CREATE PROCEDURE proc_insert () +CREATE PROCEDURE proc_insert (repeat_count int) BEGIN +DECLARE current_num int; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; +SET current_num = 0; SET SESSION wsrep_sync_wait = 0; -WHILE 1 DO +WHILE current_num < repeat_count do INSERT INTO t1 (f1) VALUES (FLOOR( 1 + RAND( ) * 65535 )); SELECT SLEEP(0.1); +SET current_num = current_num + 1; END WHILE; END| connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1; connection node_1b; -connection node_1; connection node_1b; connection node_1; DROP PROCEDURE proc_insert; DROP TABLE t1; +disconnect node_1b; CALL mtr.add_suppression("WSREP: .* conflict state after post commit "); set global innodb_status_output=Default; diff --git a/mysql-test/suite/galera/t/MW-329.test b/mysql-test/suite/galera/t/MW-329.test index 38f2007f6b620..07534a0345eb1 100644 --- a/mysql-test/suite/galera/t/MW-329.test +++ b/mysql-test/suite/galera/t/MW-329.test @@ -15,13 +15,16 @@ INSERT INTO t1 (f1) VALUES (1),(65535); # DELIMITER |; -CREATE PROCEDURE proc_insert () +CREATE PROCEDURE proc_insert (repeat_count int) BEGIN + DECLARE current_num int; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; + SET current_num = 0; SET SESSION wsrep_sync_wait = 0; - WHILE 1 DO - INSERT INTO t1 (f1) VALUES (FLOOR( 1 + RAND( ) * 65535 )); - SELECT SLEEP(0.1); + WHILE current_num < repeat_count do + INSERT INTO t1 (f1) VALUES (FLOOR( 1 + RAND( ) * 65535 )); + SELECT SLEEP(0.1); + SET current_num = current_num + 1; END WHILE; END| DELIMITER ;| @@ -31,7 +34,7 @@ DELIMITER ;| --let $connection_id = `SELECT CONNECTION_ID()` --disable_query_log --disable_result_log ---send CALL proc_insert(); +--send CALL proc_insert(500); # # Run concurrent UPDATEs. We expect that each UPDATE will report that @@ -39,7 +42,7 @@ DELIMITER ;| # --connection node_2 ---let $count = 10 +--let $count = 2 --let $wsrep_local_replays_old = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'` while ($count) @@ -78,14 +81,8 @@ while ($count) --enable_query_log # -# Terminate the stored procedure # - ---connection node_1 ---disable_query_log ---eval KILL CONNECTION $connection_id ---enable_query_log - +# --connection node_1b --error 0,2013,1317 --reap @@ -96,6 +93,8 @@ while ($count) DROP PROCEDURE proc_insert; DROP TABLE t1; +--disconnect node_1b + # Due to MW-330, Multiple "conflict state 3 after post commit" warnings if table is dropped while SP is running CALL mtr.add_suppression("WSREP: .* conflict state after post commit ");