Debian Codegraph @

mysql-test/suite/galera/t/galera_log_bin_sst.inc

raw
1 --source include/galera_cluster.inc
2 --source include/force_restart.inc
3
4 # Save original auto_increment_offset values.
5 --let $node_1=node_1
6 --let $node_2=node_2
7 --source include/auto_increment_offset_save.inc
8
9 --connection node_2
10 set global wsrep_on=OFF;
11 reset master;
12 set global wsrep_on=ON;
13 --connection node_1
14 set global wsrep_on=OFF;
15 reset master;
16 set global wsrep_on=ON;
17
18 #
19 # Test Galera with --log-bin --log-slave-updates .
20 # This way the actual MySQL binary log is used,
21 # rather than Galera's own implementation
22 #
23
24 CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
25 INSERT INTO t1 VALUES (1);
26
27 CREATE TABLE t2 (id INT) ENGINE=InnoDB;
28 INSERT INTO t2 VALUES (1);
29 INSERT INTO t2 VALUES (1);
30
31 --connection node_2
32 SELECT COUNT(*) = 1 FROM t1;
33 SELECT COUNT(*) = 2 FROM t2;
34
35 --connection node_1
36 ALTER TABLE t1 ADD COLUMN f2 INTEGER;
37 --let $MASTER_MYPORT=$NODE_MYPORT_1
38 --source include/show_binlog_events.inc
39
40 --connection node_2
41
42 #--connection node_2
43 #--source suite/galera/include/galera_stop_replication.inc
44
45 --echo Shutting down server ...
46 --source include/shutdown_mysqld.inc
47
48 --connection node_1
49 --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
50 --source include/wait_condition.inc
51
52 #
53 # Force SST
54 #
55 --echo Cleaning var directory ...
56 --remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
57 --remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mtr
58 --remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/performance_schema
59 --remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/test
60 --remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mysql
61 --remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data
62
63 --connection node_2
64
65 --echo Starting server ...
66 let $restart_noprint=2;
67 --source include/start_mysqld.inc
68
69 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
70 --source include/wait_condition.inc
71
72 --let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
73 --source include/wait_condition.inc
74
75 --connection node_2
76 SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
77 --source include/show_binlog_events.inc
78
79 DROP TABLE t1;
80 DROP TABLE t2;
81
82 --echo #cleanup
83 --connection node_1
84 SET GLOBAL wsrep_on=OFF;
85 RESET MASTER;
86 SET GLOBAL wsrep_on=ON;
87
88 # Restore original auto_increment_offset values.
89 --source include/auto_increment_offset_restore.inc