Debian Codegraph @

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

raw
1 #
2 # MDEV-15443
3 #
4 # If transactions are executed into InnoDB without wsrep_on,
5 # rseg header trx_id gets incremented and the rseg header
6 # corresponding to maximum trx_id may store undefined wsrep XID.
7 # When the wsrep XID is read from the storage engine,
8 # undefined XID may returned instead the valid one.
9 #
10 # This test demonstrates the problem by taking a node_2 out
11 # of the cluster and writing and deleting a row with
12 # wsrep_on=0. When the bug is present, node_2 will fail to
13 # rejoin the cluster because an invalid XID is read from the
14 # storage engine after startup/recovery.
15 #
16
17 --source include/have_innodb.inc
18 --source include/galera_cluster.inc
19
20 # Initialize table on node_1
21 CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
22 INSERT INTO t1 VALUES (1);
23
24 # Go to node_2, verify that the previous INSERT completed.
25 # Take node_2 out of the cluster, insert and delete a record
26 # on a table with wsrep_on.
27 --connection node_2
28 SELECT * FROM t1;
29 SET GLOBAL wsrep_cluster_address='';
30 SET SESSION wsrep_on=0;
31 INSERT INTO t1 VALUES (2);
32 DELETE FROM t1 WHERE f1 = 2;
33
34 # Shutdown node_2
35 --source include/shutdown_mysqld.inc
36
37 # On node_1, verify that the node has left the cluster.
38 --connection node_1
39 --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
40 --source include/wait_condition.inc
41
42 # Insert into t1 to enforce IST on node_2 when it is restarted.
43 INSERT INTO t1 VALUES (2);
44
45 # Restart node_2
46 --connection node_2
47 --source include/start_mysqld.inc
48 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
49 --source include/wait_condition.inc
50
51 --connection node_1
52 --source include/wait_condition.inc
53 DROP TABLE t1;