Debian Codegraph @

mysql-test/suite/galera_sr/t/MDEV-27553.test

raw
1 #
2 # MDEV-27553 Assertion `inited==INDEX' failed: int handler::ha_index_end()
3 #
4
5 --source include/galera_cluster.inc
6 --source include/have_debug.inc
7
8 --let $node_1=node_1
9 --let $node_2=node_2
10 --source suite/galera/include/auto_increment_offset_save.inc
11
12 --connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
13
14 CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
15
16 --connection node_2
17 SET SESSION wsrep_trx_fragment_size=1;
18 START TRANSACTION;
19 INSERT INTO t1 VALUES (1);
20 SELECT COUNT(*) `Expect 1` FROM mysql.wsrep_streaming_log;
21
22 #
23 # Issue ROLLBACK and make sure it fails to clean up
24 # the streaming log. Failure to remove fragments
25 # results in apply failure of the rollback fragment.
26 # The node should disconnect from the cluster.
27 #
28 SET @@global.debug_dbug="+d,ha_index_init_fail";
29 ROLLBACK;
30
31
32 #
33 # Expect the cluster to shrink
34 #
35 --connection node_1
36 SET SESSION wsrep_sync_wait = 0;
37 --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
38 --source include/wait_condition.inc
39
40 #
41 # ROLLBACK should clean up the streaming log just fine in node 1
42 #
43 SELECT COUNT(*) `Expect 0` FROM mysql.wsrep_streaming_log;
44
45
46 #
47 # Expect the failure on ROLLBACK to leave a entry in streaming log
48 #
49 --connection node_2
50 SET @@global.debug_dbug="";
51 SET SESSION wsrep_sync_wait = 0;
52 # Expect node to be disconnected
53 --let wait_condition = SELECT VARIABLE_VALUE = 'Disconnected' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
54 --source include/wait_condition.inc
55
56 SELECT COUNT(*) `Expect 1` FROM mysql.wsrep_streaming_log;
57
58
59 #
60 # Restart node 2, so that it joins the cluster back
61 #
62 --connection node_2
63 SET GLOBAL wsrep_on=OFF;
64 --source include/restart_mysqld.inc
65
66 #
67 # After restart, the streaming log is empty in node 2
68 #
69 SELECT COUNT(*) `Expect 0` FROM mysql.wsrep_streaming_log;
70
71 #
72 # Cleanup
73 #
74 DROP TABLE t1;
75
76 CALL mtr.add_suppression("WSREP: Failed to init table for index scan");
77 CALL mtr.add_suppression("WSREP: Failed to apply write set");
78 CALL mtr.add_suppression("Failed to report last committed");
79
80 --source suite/galera/include/auto_increment_offset_restore.inc