Debian Codegraph @

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

raw
1 #
2 # This test checks that the client gets an error for a BF abort,
3 # specifically when it gets detected inside the wsrep_after_statement hook
4 #
5
6 --source include/have_innodb.inc
7 --source include/galera_cluster.inc
8 --source include/have_debug_sync.inc
9
10 --connection node_1
11 # Mare sure both nodes are in the cluster
12 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
13 --source include/wait_condition.inc
14
15 CREATE TABLE t1 (id INT PRIMARY KEY, val INT);
16 INSERT INTO t1 VALUES (1, 1);
17
18 --connection node_2
19 SET DEBUG_SYNC = 'RESET';
20 # Mare sure that DLL has replicated and insert has replicated
21 --let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
22 --source include/wait_condition.inc
23 --let $wait_condition = SELECT COUNT(*) = 1 FROM t1
24 --source include/wait_condition.inc
25
26 START TRANSACTION;
27 SET DEBUG_SYNC = 'wsrep_after_statement_enter SIGNAL blocked WAIT_FOR continue';
28 --send UPDATE t1 SET val=2 WHERE id=1
29
30 --connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
31 SET DEBUG_SYNC = 'now WAIT_FOR blocked';
32
33 --connection node_1
34 # cause BF abort on other node
35 UPDATE t1 SET val=3 WHERE id=1;
36
37 --connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2
38 set session wsrep_sync_wait=0;
39 --let $wait_condition = SELECT COUNT(*) = 1 FROM t1 where id = 1 and val = 3
40 --source include/wait_condition.inc
41
42 --connection node_2a
43 SET DEBUG_SYNC = 'now SIGNAL continue';
44
45 --connection node_2
46 # check we get BF aborted
47 --error ER_LOCK_DEADLOCK
48 --reap
49 COMMIT;
50 SET DEBUG_SYNC = 'RESET';
51
52 --connection node_1
53 SET DEBUG_SYNC = 'RESET';
54 DROP TABLE t1;
55
56 --disconnect node_2a
57 --disconnect node_2b