Which command set would make the slave current?

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?

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:



Leave a Reply 14

Your email address will not be published. Required fields are marked *


Me

Me

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 .

Me

Me

My mistake, B. Didn`t see ” .. currently using a delayed replication of one hour ..”

Steve

Steve

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.

kyo

kyo

A
my MASTER_AUTO_POSITION=1

mutex

mutex

master_auto_position works only with GTID.

Tim Little

Tim Little

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.

Malika

Malika

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.

mutex

mutex

CHANGE MASTER preserve previous values. To clear them, you have to issue RESET SLAVE.