Debian Codegraph @

mysql-test/suite/sys_vars/t/innodb_fatal_semaphore_wait_threshold.test

raw
1 --source include/have_debug.inc
2 --source include/have_debug_sync.inc
3
4 # Can't test this with embedded server
5 --source include/not_embedded.inc
6
7 # Don't test this with valgrind
8 --source include/not_valgrind.inc
9
10 # Only test for innodb
11 --source include/have_innodb.inc
12
13 connect (con1,localhost,root,,);
14 CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
15
16 SET DEBUG_SYNC='create_table SIGNAL stuck WAIT_FOR ever';
17 send CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
18
19 connect (con2,localhost,root,,);
20 SET DEBUG_SYNC='now WAIT_FOR stuck';
21 FLUSH TABLES;
22
23 # The following query will be blocked on the dict_sys.mutex held by con1
24 send SELECT * FROM t1;
25
26 connection default;
27
28 --disable_result_log
29 --disable_query_log
30
31 # Since this test generates lot of errors in log, suppress checking errors
32 call mtr.add_suppression(".*");
33
34 # The crash is expected
35 exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
36
37 --echo # Waiting for mariadbd to crash
38
39 # It may take 20 seconds to detect the long semaphore and mysqld to abort.
40 # This test will be treated as pass as long as mysqld crash/restart is detected
41 # in 80 seconds.
42 let $counter= 80;
43 let $mysql_errno= 0;
44 while (!$mysql_errno)
45 {
46 --error 0,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,2002,2006,2013,5014,2026
47 show status;
48
49 dec $counter;
50 if (!$counter)
51 {
52 # This will fail this test.
53 --die Server failed to disappear
54 }
55 --sleep 1
56 }
57
58 --echo # Crash was detected
59
60 enable_reconnect;
61 connection default;
62
63 --exec echo "restart:--log-error=$error_log" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
64
65 # Call script that will poll the server waiting for it to be back online again
66 source include/wait_until_connected_again.inc;
67
68 # We only have to do drop t1, as t2 as been automatically deleted by ddl recovery
69 DROP TABLE t1;