Re: [HACKERS] Patch: Implement failover on libpq connect level.
Craig Ringer <craig@2ndquadrant.com>
From: Craig Ringer <craig@2ndquadrant.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Kevin Grittner <kgrittn@gmail.com>,
Mithun Cy <mithun.cy@enterprisedb.com>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
Peter van Hardenberg <pvh@pvh.ca>, "pgsql-jdbc@postgresql.org" <pgsql-jdbc@postgresql.org>
Date: 2016-11-17T02:09:29Z
Lists: pgsql-hackers
On 16 November 2016 at 23:13, Robert Haas <robertmhaas@gmail.com> wrote: > On Wed, Nov 16, 2016 at 9:02 AM, Kevin Grittner <kgrittn@gmail.com> wrote: >> [moving this branch of discussion to pgsql-jdbc] >> >> On Tue, Nov 15, 2016 at 10:31 PM, Mithun Cy <mithun.cy@enterprisedb.com> wrote: >> >>> JDBC is sending "show transaction_read_only" to find whether it >>> is master or not. >> >> If true, that's insane. That can be different on each connection >> to the cluster and can change tens of thousands of times per second >> on any connection! > > I don't think that's insane. The command is only being issued at > connection startup, and will only be different on different > connections if it's been configured that way. I agree. However, I also think we should make sure add a GUC_REPORT var in v10 that lets a client tell whether it's connected to a read/write or read-only node right from the start. This will save an unnecessary round-trip and some annoying log-spam. I'd rather not bind it directly to "in recovery" because we're likely to want to support read-only logical replication nodes in future, but even that would be OK. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
Commits
-
libpq: Add target_session_attrs parameter.
- 721f7bd3cbcc 10.0 landed
-
Remove superuser checks in pgstattuple
- fd321a1dfd64 10.0 cited
-
Fix unwanted flushing of libpq's input buffer when socket EOF is seen.
- c405918858c0 9.6.0 cited