| 1 |
--source include/galera_cluster.inc |
| 2 |
--source include/have_innodb.inc |
| 3 |
--source include/big_test.inc |
| 4 |
|
| 5 |
--connection node_2 |
| 6 |
call mtr.add_suppression("InnoDB: Transaction was aborted due to "); |
| 7 |
call mtr.add_suppression("WSREP: Trying to continue unpaused monitor"); |
| 8 |
|
| 9 |
--connection node_1 |
| 10 |
call mtr.add_suppression("InnoDB: Transaction was aborted due to "); |
| 11 |
call mtr.add_suppression("WSREP: Trying to continue unpaused monitor"); |
| 12 |
|
| 13 |
CREATE TABLE t1 ENGINE=InnoDB select 1 as a, 1 as b union select 2, 2; |
| 14 |
ALTER TABLE t1 add primary key(a); |
| 15 |
|
| 16 |
DELIMITER |; |
| 17 |
|
| 18 |
CREATE PROCEDURE p1(repeat_count INT) |
| 19 |
BEGIN |
| 20 |
DECLARE current_num int; |
| 21 |
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION rollback; |
| 22 |
SET current_num = 0; |
| 23 |
|
| 24 |
WHILE current_num < repeat_count DO |
| 25 |
start transaction; |
| 26 |
update t1 set b=connection_id() where a=1; |
| 27 |
commit; |
| 28 |
SET current_num = current_num + 1; |
| 29 |
END WHILE; |
| 30 |
END| |
| 31 |
|
| 32 |
|
| 33 |
DELIMITER ;| |
| 34 |
|
| 35 |
--connection node_2 |
| 36 |
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = 'PROCEDURE' AND ROUTINE_NAME = 'p1' |
| 37 |
--source include/wait_condition.inc |
| 38 |
|
| 39 |
--connect node_1_p1, 127.0.0.1, root, , test, $NODE_MYPORT_1 |
| 40 |
SET SESSION wsrep_sync_wait=0; |
| 41 |
send call p1(1000); |
| 42 |
--connect node_1_p2, 127.0.0.1, root, , test, $NODE_MYPORT_1 |
| 43 |
SET SESSION wsrep_sync_wait=0; |
| 44 |
send call p1(1000); |
| 45 |
--connect node_2_p1, 127.0.0.1, root, , test, $NODE_MYPORT_2 |
| 46 |
SET SESSION wsrep_sync_wait=0; |
| 47 |
send call p1(1000); |
| 48 |
--connect node_2_p2, 127.0.0.1, root, , test, $NODE_MYPORT_2 |
| 49 |
SET SESSION wsrep_sync_wait=0; |
| 50 |
send call p1(1000); |
| 51 |
|
| 52 |
connection node_1; |
| 53 |
let $counter=10; |
| 54 |
let $sleep_period=10; |
| 55 |
|
| 56 |
echo checking error log for 'BF lock wait long' message for $counter times every $sleep_period seconds ...; |
| 57 |
|
| 58 |
--let assert_text= BF lock wait long |
| 59 |
--let assert_select= BF lock wait long |
| 60 |
--let assert_count= 0 |
| 61 |
--let assert_only_after= CURRENT_TEST: galera.galera_bf_lock_wait |
| 62 |
|
| 63 |
while($counter > 0) |
| 64 |
{ |
| 65 |
--disable_query_log |
| 66 |
--disable_result_log |
| 67 |
eval do sleep($sleep_period); |
| 68 |
--enable_query_log |
| 69 |
--enable_result_log |
| 70 |
|
| 71 |
--let assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err |
| 72 |
--source include/assert_grep.inc |
| 73 |
|
| 74 |
--let assert_file= $MYSQLTEST_VARDIR/log/mysqld.2.err |
| 75 |
--source include/assert_grep.inc |
| 76 |
dec $counter; |
| 77 |
} |
| 78 |
|
| 79 |
--connection node_1_p1 |
| 80 |
--error 0,1213 |
| 81 |
--reap |
| 82 |
--connection node_1_p2 |
| 83 |
--error 0,1213 |
| 84 |
--reap |
| 85 |
--connection node_2_p1 |
| 86 |
--error 0,1213 |
| 87 |
--reap |
| 88 |
--connection node_2_p2 |
| 89 |
--error 0,1213 |
| 90 |
--reap |
| 91 |
|
| 92 |
--connection node_1 |
| 93 |
drop table t1; |
| 94 |
drop procedure p1; |
| 95 |
|
| 96 |
--disconnect node_1_p1 |
| 97 |
--disconnect node_1_p2 |
| 98 |
--disconnect node_2_p1 |
| 99 |
--disconnect node_2_p2 |