pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Haribabu Kommi <kommi.haribabu@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Jing Wang <jingwangian@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Cc: Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com>
Subject: Re: Libpq support to connect to standby server as priority
Date: Fri, 16 Nov 2018 18:56:11 +0100
Message-ID: <84d7a264fb5ad46873f6e40e10c3ee92983c55ca.camel@cybertec.at> (raw )
In-Reply-To: <28777.1542386147@sss.pgh.pa.us >
References: <CAF3+xM+8-ztOkaV9gHiJ3wfgENTq97QcjXQt+rbFQ6F7oNzt9A@mail.gmail.com >
<CAJrrPGfzSD4kmedadcDx+3vckj_kJ_jAuufgi+NsemTkWSU5Tw@mail.gmail.com >
<1530710078.2411.29.camel@cybertec.at >
<CA+TgmobfBaNaMrT5Qx+nQ=JKYYy-VOZ2xxXAhAGUSSWZ=fkm4g@mail.gmail.com >
<CAJrrPGea1hX5HmZyVzhJ3HbT8x3+2zoNp48HhPVFzQUYy5PU_w@mail.gmail.com >
<CAJrrPGcMq9YgG-aMzLK051EndUgjdnpp8_dJwJaNDZbu=sS0qQ@mail.gmail.com >
<CAJrrPGcwt0LLLzDF9c3-zWrESJCJko-HovDOrMobkaWQaJ5YUw@mail.gmail.com >
<67be09458f276c0c95a4b2a2a383dca9775d19cd.camel@cybertec.at >
<26890.1542047012@sss.pgh.pa.us >
<096a642cff0dd68b8157a5f8838e1762d0050d18.camel@cybertec.at >
<28777.1542386147@sss.pgh.pa.us >
Tom Lane wrote:
> > As it is now, the patch doesn't keep two connections open. It remembers
> > the index of the host of the first successful writable connection, but
> > closes the connection, and opens another one to that host if no read-only
> > host can be found.
>
> Oh! The reason I assumed it wasn't doing that is that such a behavior
> seems completely insane. If the point is to keep down the load on your
> master server, then connecting only to immediately disconnect is not
> a friendly way to do that --- even without counting the fact that you
> might later come back and connect again.
That's why I had argued initially to keep the session open, but you
seem to dislike that idea as well.
> If that's the best we can do, we should forget the whole feature and
> just recommend putting slave servers first in your hosts list when
> you want prefer-slave.
If you know which is which, certainly.
But in a setup with automated failover you cannot be certain which is which.
That's what the proposed feature targets.
Yours,
Laurenz Albe
view thread (149+ messages) latest in thread
Message-ID: <84d7a264fb5ad46873f6e40e10c3ee92983c55ca.camel@cybertec.at>
Permalink: ../84d7a264fb5ad46873f6e40e10c3ee92983c55ca.camel@cybertec.at/
Also on: postgresql.org/message-id/84d7a264fb5ad46873f6e40e10c3ee92983c55ca.camel@cybertec.at
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: laurenz.albe@cybertec.at, tgl@sss.pgh.pa.us, kommi.haribabu@gmail.com, robertmhaas@gmail.com, jingwangian@gmail.com, tsunakawa.takay@jp.fujitsu.com
Subject: Re: Libpq support to connect to standby server as priority
In-Reply-To: <84d7a264fb5ad46873f6e40e10c3ee92983c55ca.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox