Closed hessjcg closed 2 weeks ago
This supersedes #844 and #865.
Based on our discussion, I have updated Dialer.cache
to use a cache key that identifies an entry either by "project:region:instance" or by "domainName", not the combination "project:region:instance" + "domainName". I also simplified the logic in Dialer.connectionInfoCache()
so that it no longer checks if a domain name value is stale before returning existing cache entries.
When a connection is configured using a DNS domain name, the connector will poll the DNS TXT record every 30 seconds. If the value of the DNS record changes, the connector will close all connections to the old instance, and direct new connections to the updated instance.
Part of https://github.com/GoogleCloudPlatform/cloud-sql-go-connector/issues/842