MYSQL Read replica

27 views
Skip to first unread message

Dan Ostrosky

unread,
Apr 26, 2020, 1:39:09 PM4/26/20
to Google Cloud SQL discuss
Hi,
I have an issue with GCP Mysql.
I have one master instance with 1 read replica. sometimes when there is maintenance operation on the server some write queries are routed to the read replica instance and therefore I get the following error: The MySQL server is running with the --read-only option so it cannot execute this statement.
How should I handle this situation?
there is an option to route to replica only read queries? thx

David (Cloud Platform Support)

unread,
Apr 27, 2020, 3:50:14 PM4/27/20
to Google Cloud SQL discuss

Hello,


You will see this error occasionally. When the main instance is restarted, connections might be routed to your replica and you will get this message for write requests. We recommend that you implement error handling strategy like exponential backoff to reduce the amount of errors when this happens.


Reply all
Reply to author
Forward
0 new messages