Debian Codegraph @

mysql-test/suite/wsrep/t/MDEV-23081.test

raw
1 #
2 # MDEV-23081: Stray XA transactions at startup
3 # if node restarts with wsrep_on=OFF
4 #
5 --source include/have_wsrep.inc
6 --source include/have_innodb.inc
7 --source include/have_wsrep_provider.inc
8 --source include/have_debug_sync.inc
9
10 --let $log_bin=1
11 if (`select not @@log_bin`) {
12 --let $log_bin=0
13 }
14
15 CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
16
17 #
18 # Execute two inserts on block those after becoming
19 # prepared, and before they are committed
20 #
21 --connect con1, localhost, root
22 SET DEBUG_SYNC = "wsrep_after_certification SIGNAL after_certification_reached WAIT_FOR continue_after_certification";
23 SET DEBUG_SYNC = "wsrep_before_commit_order_enter SIGNAL before_commit_order_reached_1 WAIT_FOR continue_before_commit_order_1";
24 --send INSERT INTO t1 VALUES (9)
25
26 --connect con_ctrl, localhost, root
27 SET DEBUG_SYNC = "now WAIT_FOR after_certification_reached";
28
29 --connect con2, localhost, root
30 SET DEBUG_SYNC = "wsrep_before_commit_order_enter SIGNAL before_commit_order_reached_2 WAIT_FOR continue_before_commit_order_2";
31 --send INSERT INTO t1 VALUES (10)
32
33 --connection con_ctrl
34 SET DEBUG_SYNC = "now WAIT_FOR before_commit_order_reached_2";
35 SET DEBUG_SYNC = "now SIGNAL continue_after_certification";
36 SET DEBUG_SYNC = "now WAIT_FOR before_commit_order_reached_1";
37
38 #
39 # Kill the server
40 #
41 --connection default
42 --source include/kill_mysqld.inc
43
44 #
45 # and restart it with wsrep-on=OFF
46 #
47 let $restart_noprint=2;
48 if ($log_bin == 0) {
49 # The database could have been created with --log-bin
50 # and so let's add this parameter explicitly:
51 --let $restart_parameters=--wsrep-on=OFF --loose-innodb --loose-log-bin
52 }
53 if ($log_bin == 1) {
54 --let $restart_parameters=--wsrep-on=OFF --loose-innodb
55 }
56 --source include/start_mysqld.inc
57
58 #
59 # Expect no prepared XA transactions to be reported
60 #
61 XA RECOVER;
62
63 --disconnect con1
64 --disconnect con2
65 --disconnect con_ctrl
66 --connection default
67
68 DROP TABLE t1;
69 CALL mtr.add_suppression("You need to use --log-bin to make --binlog-format work");