Debian Codegraph @

mysql-test/suite/galera/r/galera_2primary_replica.result

raw
1 connection node_2;
2 connection node_1;
3 connect primary1, 127.0.0.1, root, , test, $NODE_MYPORT_3;
4 connect primary2, 127.0.0.1, root, , test, $NODE_MYPORT_4;
5 connection primary1;
6 # Primary1 creating user for replication
7 create user repl@'%' identified by 'repl';
8 grant all on *.* to repl@'%';
9 connection primary2;
10 # Primary2 creating user for replication
11 create user repl2@'%' identified by 'repl2';
12 grant all on *.* to repl2@'%';
13 connect replica, 127.0.0.1, root, , test, $NODE_MYPORT_1;
14 connection replica;
15 connection node_2;
16 connection primary1;
17 connection primary2;
18 connection replica;
19 # Galera replica changing master to primary1
20 SET @@default_master_connection='stream1';
21 # Primary node changing master to primary2
22 SET @@default_master_connection='stream2';
23 START ALL SLAVES;
24 Warnings:
25 Note 1937 SLAVE 'stream1' started
26 Note 1937 SLAVE 'stream2' started
27 connection primary1;
28 # Primary 1: Creating table and populating it with data
29 CREATE TABLE t1 (id bigint auto_increment primary key, msg varchar(100)) engine=innodb;
30 # Intentionally generate 1k GTID-events
31 SELECT COUNT(*) AS EXPECT_1000 FROM t1;
32 EXPECT_1000
33 1000
34 connection primary2;
35 # Primary 2: Creating table and populating it with data
36 CREATE TABLE t2 (id bigint auto_increment primary key, msg varchar(100)) engine=innodb;
37 # Intentionally generate 1k GTID-events
38 SELECT COUNT(*) AS EXPECT_1000 FROM t2;
39 EXPECT_1000
40 1000
41 connection replica;
42 # Waiting for data to replicate to node_1
43 SELECT COUNT(*) AS EXPECT_1000 FROM t1;
44 EXPECT_1000
45 1000
46 SELECT COUNT(*) AS EXPECT_1000 FROM t2;
47 EXPECT_1000
48 1000
49 SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
50 EXPECT_1
51 1
52 SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
53 EXPECT_1
54 1
55 SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
56 @@gtid_slave_pos @@gtid_binlog_pos @@gtid_current_pos
57 3-3-1003,4-4-1003 3-3-1003,4-4-1003 3-3-1003,4-4-1003
58 connection node_2;
59 # Waiting for data to replicate to node_2
60 SELECT COUNT(*) AS EXPECT_1000 FROM t1;
61 EXPECT_1000
62 1000
63 SELECT COUNT(*) AS EXPECT_1000 FROM t2;
64 EXPECT_1000
65 1000
66 SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
67 EXPECT_1
68 1
69 SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
70 EXPECT_1
71 1
72 SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
73 @@gtid_slave_pos @@gtid_binlog_pos @@gtid_current_pos
74 3-3-1003,4-4-1003 3-3-1003,4-4-1003 3-3-1003,4-4-1003
75 connection primary1;
76 drop table t1;
77 connection primary2;
78 drop table t2;
79 # Wait until drop table is replicated on Galera
80 connection replica;
81 connection node_2;
82 connection replica;
83 STOP ALL SLAVES;
84 Warnings:
85 Note 1938 SLAVE 'stream1' stopped
86 Note 1938 SLAVE 'stream2' stopped
87 RESET SLAVE ALL;
88 connection primary1;
89 RESET MASTER;
90 connection primary2;
91 RESET MASTER;
92 connection node_1;
93 disconnect primary1;
94 disconnect primary2;
95 disconnect replica;
96 disconnect node_2;
97 disconnect node_1;
98 # End of test