Skip to content

feat: Add PSC DNS and Global Write Endpoint support to Python Connector - #1446

Merged
hessjcg merged 2 commits into
mainfrom
psc-dns-support
Aug 12, 2026
Merged

feat: Add PSC DNS and Global Write Endpoint support to Python Connector#1446
hessjcg merged 2 commits into
mainfrom
psc-dns-support

Conversation

@hessjcg

@hessjcg hessjcg commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

The Private Service Connect (PSC) DNS Name Resolution & Fallback feature enables the Python connector to securely connect to Cloud SQL database instances using Private Service Connect (PSC) DNS, custom domain names (CNAMEs), and Global Write Endpoints.

The connector can now dial PSC instances using:

Its regional DNS hostname (e.g., 0123456789ab.fedcba9876543.us-central1.sql-psc.goog)
A custom domain CNAME pointing to the instance PSC DNS hostname
A Global Write Endpoint DNS hostname (e.g., 0123456789ab.fedcba9876543.global.sql-psc.goog)
The connectors will dynamically resolve this hostname to its real Cloud SQL instance connection name via the SQL Admin API.

For Global Write Endpoints (which use the "global" region in their DNS name), the resolver bypasses direct API resolution (as "global" is not a valid API region) and forces fallback to CNAME resolution. This CNAME should point to the active regional instance DNS hostname, enabling automatic failover.

See GoogleCloudPlatform/cloud-sql-go-connector#1106

@hessjcg
hessjcg requested a review from a team as a code owner July 27, 2026 17:23
@hessjcg
hessjcg force-pushed the psc-dns-support branch 2 times, most recently from 279c124 to 2a6e9fa Compare July 28, 2026 16:31
- Implement transient vs non-transient error detection in MonitoredCache.
- Detect immutable instance DNS names using the corrected regex.
- Avoid checking error message strings by using custom exception type (DnsLoopError).

Address review comments:
- kgala2: 'Should we have a try catch block of this sort to have a graceful shut in case of transient failures?'
- hessjcg: 'Use an error code. Don'\''t check error message strings.'
- hessjcg: 'The correct logic for detecting an immutable instance dns name: IF name matches /\.sql(-\w+)?\.goog$/ AND name does not match /\.global\.sql(-\w+)?\.goog$/'
@hessjcg
hessjcg merged commit 62640f3 into main Aug 12, 2026
23 checks passed
@hessjcg
hessjcg deleted the psc-dns-support branch August 12, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants