Thread
-
Re: [PATCH] libpq: try all addresses for a host before moving to next on target_session_attrs mismatch
Jacob Champion <jacob.champion@enterprisedb.com> — 2026-05-12T20:12:54Z
On Thu, Mar 12, 2026 at 3:43 AM Evgeny Kuzin <evgeny.kuzin@outlook.com> wrote: > > I'm no DNS expert, but I can't shake the feeling that you're > > (mis)using round-robin A records to reimplement, say, SRV records > > Would reviving SRV support be a direction you'd consider architecturally sound? I'm, again, no DNS expert. But I think we'd be moving in the same direction as other cluster-aware software if we explored that approach, which feels reasonable to me. > Another thought - what about cluster-aware routing at the protocol level? A standby could redirect to the primary - similar to HTTP 302. The cluster knows its own topology, libpq stays fast and dumb about it. That would preserve the "connect me as fast as possible" ability you mentioned. Though that feels like a bigger architectural lift compared to SRV. I think there might be a good argument for having both. Topologies aren't static; ideally you want your client to navigate a failover successfully, but you probably don't want to *optimize* for constant failovers. --Jacob