I have a 2nd generation instance, with a failover instance added to it. But from time to time I get errors in my application: "Unable to connect to any of the specified MySQL hosts". Why doesn't it switch to the failover?
According to Google's documentation I don't need to do any additional changes to my application to connect to the failover server (https://cloud.google.com/sql/docs/high-availability#how_failover_affects_your_applications_and_your_instances):
When a zonal outage occurs and your master fails over to your failover replica, any existing connections to the instance are closed. However, your application can reconnect using the same connection string or IP address; you do not need to update your application after a failover.
I have also tried to restart the master instance to test the failover, from Google documentation:
Test how your application responds to lost connections by restarting your instance.
And while it's restarting, I also get the "Unable to connect to any of the specified MySQL hosts" error message on my application.
PD: My application is not hosted with Google Cloud Platform servers (on Linode), do you think the errors are caused by network connectivity between my server and Google? But then when I manually restart the master it should start the failover.