You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 18, 2025. It is now read-only.
Let's say I have one master and two slaves, semi-sync is on, rpl_semi_sync_master_wait_for_slave_count = 1
M is the master
S1 and S2 are the slaves
At some point:
S1's Executed_Gtid_Set < S2's Executed_Gtid_Set
There is a problem with S2 network. Some binlog events have not yet written to S2's relay log, but the IO_THREAD status is still running.
Then, master crash. which slave will be the new master?
Here I provide a test method for this scenario:
start a script to INSERT into table T1.
on S1 lock table t1 read, after that sql thread will block , S1's Executed_Gtid_Set will not change any more, and at this moment S2's sql thread is still running applying relay logs, so S2's Executed_Gtid_Set will be a superset of S1's Executed_Gtid_Set
on S2 run these commnad(I don't know exactly how these commands work, but the purpose is to simulate a network exception)
set slave_net_timeout = 3600 -- Just to make it easier to do tests
tc qdisc del dev ens33 root
tc qdisc add dev ens33 root handle 1: prio
tc filter add dev ens33 protocol ip parent 1: prio 1 u32 match ip dst 172.16.120.10 flowid 1:1
tc filter add dev ens33 protocol all parent 1: prio 2 u32 match ip dst 0.0.0.0/0 flowid 1:2
tc filter add dev ens33 protocol all parent 1: prio 2 u32 match ip protocol 1 0xff flowid 1:2
tc qdisc add dev ens33 parent 1:1 handle 10: netem delay 180000ms
tc qdisc add dev ens33 parent 1:2 handle 20: sfq
after run these command, S2 will not receive master's binlog event, but S2's Slave_IO_Running is still 'ON'
4. shutdown master, run tc qdisc del dev ens33 root on S2, release lock on S1
5. see who will be the new master(In our tests, the orchestrator chose S2 as the New Master, But I think S1 should be chosen as the new master)
Let's say I have one master and two slaves, semi-sync is on, rpl_semi_sync_master_wait_for_slave_count = 1
M is the master
S1 and S2 are the slaves
At some point:
Then, master crash. which slave will be the new master?
Here I provide a test method for this scenario:
after run these command, S2 will not receive master's binlog event, but S2's Slave_IO_Running is still 'ON'
4. shutdown master, run
tc qdisc del dev ens33 rooton S2, release lock on S15. see who will be the new master(In our tests, the orchestrator chose S2 as the New Master, But I think S1 should be chosen as the new master)