GoogleCloudPlatform / GoogleCloudPlatform/cloud-sql-proxy
Add support for seamless cut over to newly promoted read replica
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 352
- Avg merge
- 14h 54m
- Merged PRs (30d)
- 5
Description
### Feature Description
After promoting a read replica, the Proxy must be restarted with the new primary's instance connection name. Instead, it would be better if the Proxy could automatically connect to the newly promoted primary.
Currently, the Admin API will report if an instance is a primary or not (see [here](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances#sqlinstancetype)). Perhaps we could add support for specifying all read replicas and letting the Proxy "discover" the new primary (although this might cause a jump in Admin API quota usage).
For example,
```
./cloud-sql-proxy \
--replicas=,,
```
Note: there is a [work around](https://github.com/GoogleCloudPlatform/cloud-sql-proxy/tree/main/examples/disaster-recovery), but it requires manually wrapping the Proxy and adding a backing storage.
Contributor guide
Assessment
This issue has not been assessed yet.