Debian Codegraph @

mysql-test/suite/galera_sr/t/galera_sr_kill_all_norecovery.test

raw
1 #
2 # Kill entire cluster during SR while pc.recovery is NOT in effect
3 # after restart, confirm that the mysql.wsrep_streaming_log table is empty
4 #
5
6 --source include/galera_cluster.inc
7 --source include/big_test.inc
8
9 # Save original auto_increment_offset values.
10 --let $node_1=node_1
11 --let $node_2=node_2
12 --source ../../galera/include/auto_increment_offset_save.inc
13
14 --connection node_1
15
16 CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
17 SET SESSION wsrep_trx_fragment_size = 1;
18 SET AUTOCOMMIT=OFF;
19 START TRANSACTION;
20
21 INSERT INTO t1 VALUES (1);
22 INSERT INTO t1 VALUES (2);
23 INSERT INTO t1 VALUES (3);
24 INSERT INTO t1 VALUES (4);
25 INSERT INTO t1 VALUES (5);
26
27 --connection node_2
28 --let $wait_condition = SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log;
29 --source include/wait_condition.inc
30
31 #
32 # Kill the entire cluster and restart
33 #
34 --connection node_2
35 --source include/kill_galera.inc
36
37 --connection node_1
38 SET SESSION wsrep_sync_wait = 0;
39 --source include/kill_galera.inc
40
41 --remove_file $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
42 --let $start_mysqld_params =--wsrep-new-cluster
43 --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
44 --source include/start_mysqld.inc
45
46 --connection node_2
47 --let $start_mysqld_params =
48 --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
49 --source include/start_mysqld.inc
50
51
52 #
53 # Check that wsrep_streaming_log is empty
54 #
55 --connection node_1
56 --source include/wait_until_connected_again.inc
57 --source include/galera_wait_ready.inc
58 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
59
60 SELECT COUNT(*) `expect 0` FROM mysql.wsrep_streaming_log;
61
62 --connection node_2
63 SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
64 SELECT COUNT(*) `expect 0` FROM t1;
65 SELECT COUNT(*) `expect 0` FROM mysql.wsrep_streaming_log;
66
67
68 #
69 # Cleanup
70 #
71 --source ../../galera/include/auto_increment_offset_restore.inc
72 DROP TABLE t1;