Debian Codegraph @

mysql-test/suite/galera/t/MDEV-35446.test

raw
1 #
2 # MDEV-35446
3 #
4 # Test BF abort of a transaction under PS protocol, after
5 # a statement is prepared (and the diagnostics area is
6 # disabled).
7 #
8
9 --source include/have_debug_sync.inc
10 --source include/galera_cluster.inc
11
12 #
13 # Setup: bf_trx executes in node_1 and will BF abort victim_trx.
14 #
15 --connect bf_trx, 127.0.0.1, root, , test, $NODE_MYPORT_1
16 --connect victim_trx, 127.0.0.1, root, , test, $NODE_MYPORT_2
17 --connect node_2_ctrl, 127.0.0.1, root, , test, $NODE_MYPORT_2
18
19 CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
20
21 --connection victim_trx
22 START TRANSACTION;
23 INSERT INTO t1 VALUES (2), (1);
24
25 --connection node_2_ctrl
26 SET GLOBAL debug_dbug = '+d,sync.wsrep_apply_cb';
27
28 --connection bf_trx
29 INSERT INTO t1 VALUES (1), (2);
30
31 --connection node_2_ctrl
32 SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
33 SET GLOBAL debug_dbug = '';
34
35 #
36 # COMMIT the victim_trx and expect a deadlock error.
37 # Here we park the client in a sync point at the end of prepare
38 # command (COM_STMT_PREPARE), where the diagnostics area of the
39 # client has already been disabled. The client signals the
40 # applier to continue and will be BF aborted.
41 # If bug is present, the transaction is aborted, but the COMMIT
42 # statement succeeds (instead of returning deadlock error).
43 #
44 --connection victim_trx
45
46 --disable_ps_protocol
47 SET DEBUG_SYNC = "wsrep_at_dispatch_end_before_result SIGNAL signal.wsrep_apply_cb WAIT_FOR bf_abort";
48 --enable_ps_protocol
49
50 --error ER_LOCK_DEADLOCK
51 COMMIT;
52
53 #
54 # Cleanup
55 #
56 SET DEBUG_SYNC = 'RESET';
57 DROP TABLE t1;