Re: Proposal: Implement failover on libpq connect level.
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: "Victor Wagner *EXTERN*" <vitus@wagner.pp.ru>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2015-08-19T06:59:51Z
Lists: pgsql-hackers
On Wed, Aug 19, 2015 at 12:21 PM, Victor Wagner *EXTERN* <vitus@wagner.pp.ru> wrote: > > On 2015.08.18 at 08:32:28 +0000, Albe Laurenz wrote: > > > I wonder how useful this is at the present time. > > > > If the primary goes down and the client gets connected to the standby, > > it would have read-only access there. Most applications wouldn't cope > > well with that. > > It is supposed that somebody (either system administrator or some > cluster management software) have noticed failure of master and promoted > one of the standbys to master. > > So, clients have only to find out which cluster node serves as master > just now. > > Idea is that we don't need any extra administration actions such as IP > migration to do it. Clients have list of alternate servers and discover > which one to work with by trial and error. > > I consider in my proposal following situations: > > 1. Warm standby - doesn't accept client connection at all unless > promoted to master. > > 2. Hot standby - we have two types of clients - one for which readonly > access is sufficient, and other that need to connect only to master. > In this case intention to write is explicitely stated in the connect > string (readonly=false) and connect procedure would check if node it > tries to connect allowed write. > > It seems that most people discussing in this thread think in millisecond > time intervals (failure and immediate reconnect). Why not have this as a separate parameter (*_timeout or something like that)? With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com
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