mysql.rds_set_source_delay - Amazon Relational Database Service


Sets the minimum number of seconds to delay replication from source database instance to the current read replica. Use this procedure when you are connected to a read replica to delay replication from its source database instance.


CALL mysql.rds_set_source_delay( delay );



The minimum number of seconds to delay replication from the source database instance.

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 primary 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 for MySQL.

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

  • MySQL 8.0.26 and higher 8.0 versions

  • All 5.7 versions


To delay replication from source database instance 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);