An existing master-slave setup is currently using a delayed replication of one hour. The master
has crashed and the slave must be ”rolled forward” to provide all the latest data.
The SHOW SLAVE STATUS indicates the following values:
RELAY_LOG_FILE = hostname-relay-bin.00004
RELAY_LOG_POS = 1383
Which command set would make the slave current?
A.
STOP SLAVE; CHANGE MASTER TO MASTER_DELAY=0; START SLAVE;
B.
STOP SLAVE; CHANGE MASTER TO MASTER_DELAY =0, RELAY_LOG_FILE = ‘hostnamerelay-bin.00004’ , RELAY_LOG_POS = 1383;
C.
STOP SLAVE; CHANGE MASTER TO RELAY_LOG_FILE = ‘hostname-relay-bin.00004’,
RELAY_LOG_POS = 1383;
D.
STOP SLAVE; SET GLOBAL master_delay =0; START SLAVE;
Explanation:
B.
According to 17.3.9 Delayed Replication RM , The default delay is 0 seconds. START SLAVE and STOP SLAVE take effect immediately and ignore any delay. So -> C .
My mistake, B. Didn`t see ” .. currently using a delayed replication of one hour ..”
The answer is A.
The relay log file and position are already set, per the SHOW SLAVE STATUS.
If you look, B does not include a START SLAVE statement.
Since the relay log info is already set, all you need to do is follow A.
This seems to point to B as well. Though it is missing start slave.
http://forums.mysql.com/read.php?26,590060,590060
A and B are equivalent, but A has the START SLAVE.
A
my MASTER_AUTO_POSITION=1
master_auto_position works only with GTID.
If MASTER had crashed, then setting the master-delay and starting slave shouldn’t help, right?
Answer A is just setting delay to 0 and starting slave.
Answer C is just setting the relay log settings to their current values, useless!
Answer B is answer A ALONG with setting the relay log stuff to precisely what it already is, so that’s pointless.
Answer D doesn’t even make sense…
My vote is answer A.
A
A
It should be B, (though start slave is missing)…B because if in change master to statement relay_log_file and relay_log_pos are not given, it deletes all relay log files. So we wont be able to roll forward if relay log files get deleted.
CHANGE MASTER preserve previous values. To clear them, you have to issue RESET SLAVE.
A