blob: b790ab8462bfb13a4bfc52fa47655e9976549548 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
include/rpl_init.inc [topology=1->2->1]
#
# For now we'll only have 1->2 running
#
# Server 1
# Stop replication 2->1
connection server_1;
include/stop_slave.inc
#
# Server 2
# Use GTID for replication 1->2
connection server_2;
include/stop_slave.inc
change master to master_use_gtid=slave_pos;
include/start_slave.inc
#
# Create some 0-1-* and 0-2-* events in binlog of server 2
connection server_1;
create table t1 (i int) engine=InnoDB;
insert into t1 values (1);
connection server_2;
create table t2 (i int) engine=InnoDB;
connection server_1;
insert into t1 values (2);
connection server_2;
insert into t2 values (1);
#
# All events are present in the binlog of server 2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; create table t1 (i int) engine=InnoDB
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Query # # use `test`; insert into t1 values (1)
slave-bin.000001 # Xid # # COMMIT /* XID */
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; create table t2 (i int) engine=InnoDB
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Query # # use `test`; insert into t1 values (2)
slave-bin.000001 # Xid # # COMMIT /* XID */
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Query # # use `test`; insert into t2 values (1)
slave-bin.000001 # Xid # # COMMIT /* XID */
#
# Server 1
# Start replication 2->1 using GTID,
connection server_1;
change master to master_use_gtid=slave_pos;
include/start_slave.inc
select * from t1 order by i;
i
1
2
select * from t2 order by i;
i
1
connection server_2;
select * from t1 order by i;
i
1
2
select * from t2 order by i;
i
1
connection server_1;
drop table t1;
connection server_2;
drop table t2;
include/rpl_end.inc
|