Re: Patch (2): Implement failover on libpq connect level.

From: Victor Wagner <vitus(at)wagner(dot)pp(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch (2): Implement failover on libpq connect level.
Date: 2015-10-23 11:52:33
Message-ID: 20151023145233.2a110244@fafnir
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

On Thu, 22 Oct 2015 14:33:11 +0100
Thom Brown <thom(at)linux(dot)com> wrote:

> On 21 October 2015 at 10:07, Victor Wagner <vitus(at)wagner(dot)pp(dot)ru> wrote:
> > On 2015.10.14 at 13:41:51 +0300, Victor Wagner wrote:
> >
> >>
> >> Attached patch which implements client library failover and
> >> loadbalancing as was described in the proposal
> >> <20150818041850(dot)GA5092(at)wagner(dot)pp(dot)ru>.
> >>
> >
> > I'm sending imporoved verison of patch. As Olexander Shulgin noted,
> > previous version of patch lacks support for service files.
> >
> > Now support for service files is implemented and multiple host
> > statements in the service file are allowed.
>
> This is causing breakage:
>
> $ pg_basebackup -v -x -D standby1 -h localhost -p 5532 -U rep_user
> row number 0 is out of range 0..-1

It seems that pg_basebackup should always specify readonly attribute
for the connection.

Your data directory is named standby1, so I suspect
that you are trying to make backup from read-only standby instance of
the base.

Can you check if problem persists in your setup with command

pg_basebackup -v -x -D standby1 \
-d "host=localhost port=5532 user=rep_user readonly=1"

> Segmentation fault

Of course, this shouldn't happen even if libpq is severely misused.
And it is almost evident what should be done to fix it.
But making sure that my patch doesn't interfere with operation of
pg_basebackup is a bit more complicated.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-10-23 11:59:59 Re: [patch] extensions_path GUC
Previous Message Amit Kapila 2015-10-23 11:11:31 Re: Parallel Seq Scan

Browse pgsql-jdbc by date

  From Date Subject
Next Message Korry Douglas 2015-10-23 20:02:33 Re: Patch (2): Implement failover on libpq connect level.
Previous Message Thom Brown 2015-10-22 13:33:11 Re: Patch (2): Implement failover on libpq connect level.