ClickHouse / ClickHouse/clickhouse-go

Suggest: DNS A/AAAA-based host discovery & periodic re-resolution for dynamic endpoints

Open
#1,745 2 comments 0 reactions 0 assignees View on GitHub
NewFeature
Dominant language
Go
Stars
3.3k
Forks
680
Avg merge
2d 3h
Merged PRs (30d)
14

Description

If my understanding of the clickhouse-go is incorrect, please let me know.

clickhouse-go supports providing multiple hosts for load-balancing/failover via Options.Addr or the DSN hosts parameter. However, this requires a static list of endpoints.

In Kubernetes (and other dynamic environments), we commonly connect via:
- DNS name (single hostname, multiple A/AAAA records)

In these setups, the set of IPs behind a hostname can change over time (rolling updates, pod churn, scale up/down). Today, users must implement DNS resolution outside the driver and rebuild connections manually, which is operationally fragile and duplicates logic across services.

### I need
- Resolve a hostname to all A/AAAA addresses and treat them as the host pool (similar to how the DSN hosts list is used).
- Re-resolve periodically (or on reconnect) so the pool updates when DNS changes.

### Example
`clickhouse://my-clickhouse-01.dns:9000/db?resolve_dns=1&resolve_dns_interval=30s`

Contributor guide

Open the contributing guide

Research direction

Start by tracing Options.Addr and DSN host parsing in the driver; no specific files or tests are named in the issue. Define how A/AAAA results populate the host pool and how reconnect or a 30s interval refreshes it, then verify behavior against DNS changes and failover.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.