Debian Codegraph @

mysql-test/suite/galera/t/galera_performance_schema.test

raw
1 #
2 # Test that wsrep mutexes, condition variables, files and
3 # threads are shown in performance schema
4 #
5 --source include/galera_cluster.inc
6 --source include/have_perfschema.inc
7
8 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
9 --source include/wait_condition.inc
10
11 use performance_schema;
12
13 --vertical_results
14 --disable_ps_protocol
15 SELECT name
16 FROM threads
17 WHERE name LIKE 'thread/sql/wsrep%'
18 ORDER BY name;
19 --enable_ps_protocol
20
21 use test;
22 create table t1 (a int not null primary key) engine=innodb;
23 insert into t1 values (1),(2);
24
25 use performance_schema;
26 select name from mutex_instances where name like 'wait/synch/mutex/sql/LOCK_wsrep%' order by name;
27 select name from cond_instances where name like 'wait/synch/cond/sql/COND_wsrep%' order by name;
28
29 # Whenever a node fails to apply an event on a slave node, the database server creates a
30 # special binary log file of the event in the data directory. The naming convention the
31 # node uses for the filename is GRA_*.log.
32 # Thus, we need to produce a applier failure
33
34 --connection node_2
35 --exec rm -rf $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log
36
37 # Create applier failure
38
39 use test;
40 SET SESSION wsrep_on=OFF;
41 CREATE TABLE t2 (f1 INTEGER) engine=innodb;
42
43 --connection node_1
44 use test;
45 CREATE TABLE t2 (f1 INTEGER) engine=innodb;
46
47 --connection node_2
48 SET SESSION wsrep_on=ON;
49 SELECT COUNT(*) FROM t1;
50
51 use performance_schema;
52 #
53 # Below we can't just count number of files as if you run this test more
54 # than once, test will create more files
55 #
56 select count(*)>=1 from file_instances where file_name like '%GRA_%.log';
57 CALL mtr.add_suppression("Slave SQL: Error 'Table 't2' already exists' on query");
58
59 use test;
60 drop table t1;
61 drop table t2;