| 1 |
include/rpl_init.inc [topology=1->2,4->3] |
| 2 |
Warnings: |
| 3 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 4 |
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information. |
| 5 |
Warnings: |
| 6 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 7 |
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information. |
| 8 |
include/rpl_connect.inc [creating master] |
| 9 |
include/rpl_connect.inc [creating master1] |
| 10 |
include/rpl_connect.inc [creating slave] |
| 11 |
include/rpl_connect.inc [creating slave1] |
| 12 |
include/rpl_start_slaves.inc |
| 13 |
Cluster A servers have no epoch replication info |
| 14 |
select count(1) from mysql.ndb_apply_status; |
| 15 |
count(1) |
| 16 |
0 |
| 17 |
Cluster A servers have no max replicated epoch value |
| 18 |
Master(1) |
| 19 |
select variable_name, variable_value from performance_schema.global_status |
| 20 |
where variable_name='Ndb_slave_max_replicated_epoch'; |
| 21 |
variable_name variable_value |
| 22 |
Ndb_slave_max_replicated_epoch 0 |
| 23 |
Master1(3) |
| 24 |
select variable_name, variable_value from performance_schema.global_status |
| 25 |
where variable_name='Ndb_slave_max_replicated_epoch'; |
| 26 |
variable_name variable_value |
| 27 |
Ndb_slave_max_replicated_epoch 0 |
| 28 |
Make a change originating at Cluster A |
| 29 |
Master(1) |
| 30 |
use test; |
| 31 |
create table t1 (a int primary key, b varchar(100)) engine=ndb; |
| 32 |
insert into t1 values (1, "Venice"); |
| 33 |
Allow it to propagate to Cluster B |
| 34 |
Originate a second unrelated change at Cluster B, to allow us to wait for |
| 35 |
reverse propagation in the testcase |
| 36 |
Slave1 (4) |
| 37 |
insert into t1 values (2, "Death"); |
| 38 |
Allow it to propagate to Cluster A |
| 39 |
Observe new entry in ndb_apply_status on Cluster A |
| 40 |
Master (1) |
| 41 |
select server_id from mysql.ndb_apply_status order by server_id; |
| 42 |
server_id |
| 43 |
1 |
| 44 |
4 |
| 45 |
Non-slave server on Cluster A will have no value for Max Replicated Epoch |
| 46 |
select variable_name, variable_value from performance_schema.global_status |
| 47 |
where variable_name='Ndb_slave_max_replicated_epoch'; |
| 48 |
variable_name variable_value |
| 49 |
Ndb_slave_max_replicated_epoch 0 |
| 50 |
Slave server on Cluster A has current value for Max Replicated Epoch |
| 51 |
Master1 (3) |
| 52 |
Expect count 1 |
| 53 |
select |
| 54 |
count(1) |
| 55 |
from |
| 56 |
performance_schema.global_status, |
| 57 |
mysql.ndb_apply_status |
| 58 |
where |
| 59 |
server_id = 1 |
| 60 |
and |
| 61 |
variable_name='Ndb_slave_max_replicated_epoch' |
| 62 |
and |
| 63 |
variable_value = epoch; |
| 64 |
count(1) |
| 65 |
1 |
| 66 |
Now wait for all replication to quiesce |
| 67 |
Now swap replication channels around |
| 68 |
include/rpl_stop_slaves.inc |
| 69 |
include/rpl_change_topology.inc [new topology=2->1,3->4] |
| 70 |
Warnings: |
| 71 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 72 |
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information. |
| 73 |
Warnings: |
| 74 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 75 |
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information. |
| 76 |
Get current master status on Cluster A new master (next pos in Binlog) |
| 77 |
Master1 (3) |
| 78 |
Flush logs to ensure any pending update (e.g. reflected apply_status write row) |
| 79 |
is skipped over. |
| 80 |
flush logs; |
| 81 |
Setup slave on Cluster B to use it |
| 82 |
Slave1 (4) |
| 83 |
Get current master status on Cluster B new master (next pos in Binlog) |
| 84 |
Slave (2) |
| 85 |
Flush logs to ensure any pending update (e.g. reflected apply_status write row) |
| 86 |
is skipped over. |
| 87 |
flush logs; |
| 88 |
Setup slave on Cluster A to use it |
| 89 |
Master (1) |
| 90 |
Master (1) |
| 91 |
Show that Cluster A Slave server (old master) has no Max replicated epoch before receiving data |
| 92 |
select variable_name, variable_value from performance_schema.global_status |
| 93 |
where variable_name='Ndb_slave_max_replicated_epoch'; |
| 94 |
variable_name variable_value |
| 95 |
Ndb_slave_max_replicated_epoch 0 |
| 96 |
Master1 (3) |
| 97 |
Cluster A Master server (old slave) has old Max replicated epoch |
| 98 |
select |
| 99 |
count(1) |
| 100 |
from |
| 101 |
performance_schema.global_status, |
| 102 |
mysql.ndb_apply_status |
| 103 |
where |
| 104 |
server_id = 1 |
| 105 |
and |
| 106 |
variable_name='Ndb_slave_max_replicated_epoch' |
| 107 |
and |
| 108 |
variable_value = epoch; |
| 109 |
count(1) |
| 110 |
1 |
| 111 |
Now start slaves up |
| 112 |
include/rpl_start_slaves.inc |
| 113 |
Show that applying something from Cluster B causes the |
| 114 |
old Max Rep Epoch to be loaded from ndb_apply_status |
| 115 |
There is no new Max Rep Epoch from Cluster A as it has not changed |
| 116 |
anything yet |
| 117 |
Slave (2) |
| 118 |
insert into test.t1 values (3, "From the Sea"); |
| 119 |
Allow to propagate to Cluster A |
| 120 |
Master (1) |
| 121 |
New Slave server on Cluster A has loaded old Max-Replicated-Epoch |
| 122 |
select server_id from mysql.ndb_apply_status order by server_id; |
| 123 |
server_id |
| 124 |
1 |
| 125 |
2 |
| 126 |
4 |
| 127 |
select |
| 128 |
count(1) |
| 129 |
from |
| 130 |
performance_schema.global_status, |
| 131 |
mysql.ndb_apply_status |
| 132 |
where |
| 133 |
server_id = 1 |
| 134 |
and |
| 135 |
variable_name='Ndb_slave_max_replicated_epoch' |
| 136 |
and |
| 137 |
variable_value = epoch into @result; |
| 138 |
select @result; |
| 139 |
@result |
| 140 |
1 |
| 141 |
Now make a new Cluster A change and see that the Max Replicated Epoch advances |
| 142 |
once it has propagated |
| 143 |
Master1 (3) |
| 144 |
insert into test.t1 values (4, "Brooke"); |
| 145 |
Propagate to Cluster B |
| 146 |
Make change on Cluster B to allow waiting for reverse propagation |
| 147 |
Slave (2) |
| 148 |
insert into test.t1 values (5, "Rupert"); |
| 149 |
Wait for propagation back to Cluster A |
| 150 |
Master (1) |
| 151 |
Show that Cluster A now has 2 different server_id entries in ndb_apply_status |
| 152 |
Those from the new master (server_id 3) are highest. |
| 153 |
select server_id from mysql.ndb_apply_status order by server_id; |
| 154 |
server_id |
| 155 |
1 |
| 156 |
2 |
| 157 |
3 |
| 158 |
4 |
| 159 |
select |
| 160 |
count(1) |
| 161 |
from |
| 162 |
performance_schema.global_status, |
| 163 |
mysql.ndb_apply_status |
| 164 |
where |
| 165 |
server_id = 3 |
| 166 |
and |
| 167 |
variable_name='Ndb_slave_max_replicated_epoch' |
| 168 |
and |
| 169 |
variable_value = epoch; |
| 170 |
count(1) |
| 171 |
1 |
| 172 |
local_server_with_max_epoch |
| 173 |
3 |
| 174 |
Done |
| 175 |
drop table t1; |
| 176 |
include/rpl_stop_slaves.inc |
| 177 |
CHANGE REPLICATION SOURCE TO IGNORE_SERVER_IDS= (); |
| 178 |
CHANGE REPLICATION SOURCE TO IGNORE_SERVER_IDS= (); |
| 179 |
CHANGE REPLICATION SOURCE TO IGNORE_SERVER_IDS= (); |
| 180 |
CHANGE REPLICATION SOURCE TO IGNORE_SERVER_IDS= (); |
| 181 |
include/rpl_start_slaves.inc |
| 182 |
include/rpl_end.inc |