Discussion summary: Proposal: Implement failover on libpq connect level.

From: Victor Wagner <vitus(at)wagner(dot)pp(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Discussion summary: Proposal: Implement failover on libpq connect level.
Date: 2015-09-06 19:27:10
Message-ID: 20150906222710.3d6bccdb@wagner.wagner.home
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

First of all, I wish to thank all the participants of the discussion
for their useful suggestions and critics.

I see that people are really interested in this feature.

Now, list of syntax and behavior changes against original proposal:

1. There is similar feature in JDBC, so syntax of URL-style connect
string should be compatible with JDBC:

postgresql://host:port,host:port/dbname...

2. In the param=value style connect string, there should be way to
specify different non-standard port for each host in the cluster.

So on, it seems that people came to conclusion, that allowing host:port
syntax as value of the host parameter shouldn't break anything.

So, port should be determined following way:

If there is :portnumber in the host string, this portnumber takes
precedence over anything else for this particular host. To avoid
problems with file system objects with strange names, colon is
interpreted as port number separator only if value of the host
parameter doesn't begin with slash. If it begins with slash, it is
handled exactly as it handled now.

If port is not explicitly specified in the host string, then use
parameter port= (for all hosts, which are not accompanied with own port
number), if no port parameter in the connect string, use same chain of
fallbacks up to compiled in standard value, as in use now.

3. Simultaneous connection to all the hosts in cluster shouldn't be
default. By default hosts should be tried in order they are specified
in the connect string. To minimize syntax changes there should be
single parameter 'hostorder' which specifies order of hosts with
possible choices
sequential(default), parallel and random.

4. There should be a way to allow cluster software or system
administrator some time to perform failover procedures and promote one
of standbys to master. So, there should be additional parameter,
failover_timeout, which specifies number of seconds connection attempts
should be retried, if no usable master server found.

5. Parameter readonly (which allows to distinguish between failover and
load balancing of readonly clients) should be implemented as in
original proposal.

--
Victor Wagner <vitus(at)wagner(dot)pp(dot)ru>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2015-09-06 19:34:28 Re: exposing pg_controldata and pg_config as functions
Previous Message Tom Lane 2015-09-06 18:58:47 Re: PL/pgSQL, RAISE and error context

Browse pgsql-jdbc by date

  From Date Subject
Next Message Daniel Verite 2015-09-07 15:32:48 Re: Proposal: Implement failover on libpq connect level.
Previous Message Bruce Momjian 2015-09-04 23:43:03 Re: Proposal: Implement failover on libpq connect level.