Cloud SQL HA maintenance

238 views
Skip to first unread message

chen levi

unread,
Feb 13, 2020, 10:40:35 AM2/13/20
to Google Cloud SQL discuss
Hi

we've recently enabled HA on our Cloud SQL.
this enables the standby instance along with the primary instance for our DB.

until now during scheduled maintenance windows we've encountered downtime of few minutes.
i know that failover replica (the previous HA solution) did not helped in such cased and im trying to understand if this standby instance also does not help in achieving zero downtime.

i understand per the documentation , that during maintenance for the primary instance, there will be no failover to the standby instance as described here : 

For Cloud SQL to allow a failover, the configuration must meet the following requirements:

- The primary instance must be in a normal operating state (not stopped, undergoing maintenance, or performing a long-running operation).
- The secondary zone and standby instance must both be in a healthy state. When the standby instance is unhealthy and/or replication to the secondary zone is interrupted, failover operations are blocked. After Cloud SQL repairs the standby instance and the secondary zone is available, replication resumes and Cloud SQL allows failover.

the thing is , i still have 2 questions:
- during the primary instance maintenance windows, does the standby instance also being upgraded?
- if its not , does it make sense to initiate manually failover right before the maintenance to the standby instance to prevent downtime?  is it duable?

thanks
Chen

Olu

unread,
Feb 13, 2020, 2:49:35 PM2/13/20
to Google Cloud SQL discuss

Q: - during the primary instance maintenance windows, is the standby instance also being upgraded?


A: Maintenance done on the CloudSQL Instances are not done at exactly the same time. However, from sample instances that I checked, it seems the maintenance on Failover Instances is done just a few minutes apart from the Maintenance on the Primary Instance. 


Q: - if it's not, does it make sense to initiate manually failover right before the maintenance to the standby instance to prevent downtime?  is it doable?

A: Considering my response above, it may not be advisable to trigger the failover right before the maintenance on the primary instance as the Maintenance process may be done a few minutes apart. 


While triggering your failover Instance before the Maintenance on primary instance may be doable, there are a number of factors that may apply. For example, how to determine exactly when the maintenance would take place(Maintenance window only allows for specifying a time window).


I'd rather you carefully review your planned maintenance Window to minimize the impact on your application. Better still, you can setup a Read replica[1] which would ensure that read operations can still be completed during the down time imposed by the maintenance. Checking samples instances on my end, I observed that the maintenance on Read replicas seem to be done only after the completion of the maintenance on Failover and primary Instances. 


[1]https://cloud.google.com/sql/docs/mysql/replication/tips/#read-replica


Olu

unread,
Feb 13, 2020, 2:58:09 PM2/13/20
to Google Cloud SQL discuss
Please note though that the availability of the Read replica during Maintenance Window of the Primary Instance is not guaranteed. As indicated on this Documentation[1], Maintenance can occur at any time on the read replica.

Olu

unread,
Feb 16, 2020, 3:59:45 PM2/16/20
to Google Cloud SQL discuss
A quick follow up to this statement below, actually, as indicated in this documentation[1], there is a way to receive notifications about the CloudSQL maintenance. This notification could be received by email once it is configured. 

Reply all
Reply to author
Forward
0 new messages