Re: [HACKERS] Patch: Implement failover on libpq connect level.

From: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
To: 'Craig Ringer' <craig(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Kevin Grittner <kgrittn(at)gmail(dot)com>, Mithun Cy <mithun(dot)cy(at)enterprisedb(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Peter van Hardenberg <pvh(at)pvh(dot)ca>, "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: [HACKERS] Patch: Implement failover on libpq connect level.
Date: 2016-11-17 02:49:51
Message-ID: 0A3221C70F24FB45833433255569204D1F6413C9@G01JPEXMBYT05
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

From: pgsql-jdbc-owner(at)postgresql(dot)org
> [mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of Craig Ringer
> >> 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.

Yes, I meant the GUC_REPORT method. I don't think something like read-only and read/write is intuitive as values values of target_server_type, because people who want to use reporting apps that use temporary tables have to connect to the primary, because temp tables are not supported on standbys. I think the current notion of primary/standby is good; those who require temp tables need to specify primary.

> 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.

Maybe we should determine the name and value of the connection parameter and GUC-REPORTed variable in light of the logical replication.

Regards
Takayuki Tsunakawa

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-11-17 02:51:45 Re: Password identifiers, protocol aging and SCRAM protocol
Previous Message Craig Ringer 2016-11-17 02:42:54 Re: Document how to set up TAP tests for Perl 5.8.8

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tsunakawa, Takayuki 2016-11-17 02:56:32 Re: Patch: Implement failover on libpq connect level.
Previous Message Tsunakawa, Takayuki 2016-11-17 02:29:58 Re: Patch: Implement failover on libpq connect level.