Search code examples
mysqlsql-servergoogle-cloud-storagegoogle-cloud-platformgoogle-cloud-sql

Can't delete google cloud sql replication master instance


I decided to play around with Google Could SQL and I setup a test sql instance, loaded it with some data and then setup replication on it in the google dev console. I did my testing and found out it all works great, the master/slave setup works as it should and my little POC was a success. So now I want to delete the POC sql instances but that's not going so well.

I deleted the replica instance fine (aka the 'slave') but for some reason the master instance still thinks there is a slave and therefore will not let me delete it. For example I run the following command in the gclound shell:

gcloud sql instances delete MY-INSTANCE-NAME

I get the following message:

ERROR: (gcloud.sql.instances.delete) The requested operation is not valid for a replication master instance.

This screenshot also shows that in the google dev console it clearly thinks there are no replicas attached to this instance (because I deleted them) but when I run:

gcloud sql instances describe MY-INSTANCE-NAME

It shows that there is a replica name still attached to the instance.

Any ideas on how to delete this for good? Kinda lame to keep on paying for this when it was just a POC that I want to delete (glad I didn't pick a high memory machine!)


Solution

  • Issue was on Google's side and they fixed it. Here were the sequence of events that led to the issue happening:
    1) Change master's tier
    2) Promote replica to master while the master tier change is in progress