Amazon Relational Database Service
User Guide (API Version 2014-10-31)

mysql.rds_set_source_delay

Sets the minimum number of seconds to delay replication from the master to the current Read Replica. Use this procedure when you are connected to a Read Replica to delay replication from its master.

Syntax

CALL mysql.rds_set_source_delay( delay );

Parameters

delay

The minimum number of seconds to delay replication from the master.

The limit for this parameter is one day (86400 seconds).

Usage Notes

The master user must run the mysql.rds_set_source_delay procedure.

For disaster recovery, you can use this procedure with the mysql.rds_start_replication_until stored procedure or the mysql.rds_start_replication_until_gtid stored procedure. To roll forward changes to a delayed Read Replica to the time just before a disaster, you can run the mysql.rds_set_source_delay procedure. After the mysql.rds_start_replication_until or mysql.rds_start_replication_until_gtid procedure stops replication, you can promote the Read Replica to be the new master DB instance by using the instructions in Promoting a Read Replica to Be a Standalone DB Instance.

To use the mysql.rds_rds_start_replication_until_gtid procedure, GTID-based replication must be enabled. To skip a specific GTID-based transaction that is known to cause disaster, you can use the mysql.rds_skip_transaction_with_gtid stored procedure. For more information on GTID-based replication, see Using GTID-Based Replication for Amazon RDS MySQL.

The mysql.rds_set_source_delay procedure is available in these versions of Amazon RDS MySQL:

  • MySQL 5.6.40 and later 5.6 versions

  • MySQL 5.7.22 and later 5.7 versions

Examples

To delay replication from the master to the current Read Replica for at least one hour (3,600 seconds), you can call mysql.rds_set_source_delay with the following parameter:

CALL mysql.rds_set_source_delay(3600);