Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What all happens when we promote a read replica to separate RDS instance?

I tried promoting a read replica to a separate RDS instance. It took nearly 10 minutes to complete and during that time. As far as I can think, it should just break the replication process, sync for the time lag. But I saw the db instance getting rebooted also in case of EC2 RDS. Can someone please clearly explain to me the whole process?

like image 548
pradeepchhetri Avatar asked Dec 05 '12 19:12

pradeepchhetri


1 Answers

According to http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html rebooting is part of the process:

The following steps show the general process for promoting a read replica to a Single-AZ DB instance.

  1. Stop any transactions from being written to the read replica source DB instance, and then wait for all updates to be made to the read replica. Database updates occur on the read replica after they have occurred on the source DB instance, and this replication "lag" can vary significantly. Use the Replica Lag metric to determine when all updates have been made to the read replica.

  2. To be able to make changes to the read replica, you must the set the read_only parameter to 0 in the DB parameter group for the read replica.

  3. Perform all needed DDL operations, such as creating indexes, on the read replica. Actions taken on the read replica do not affect the performance of the source DB instance.

  4. Promote the read replica by using the Promote Read Replica option on the RDS console, the CLI command rds-promote-read-replica, or the PromoteReadReplica API operation.

Note The promotion process takes a few minutes to complete. When you promote a read replica, replication is stopped and the read replica is rebooted. When the reboot is complete, the read replica is available as a Single-AZ DB instance.

like image 178
Bruce P Avatar answered Sep 29 '22 12:09

Bruce P