pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Teodor Sigaev <teodor@sigaev.ru>
To: Victor Wagner <vitus@wagner.pp.ru>
To: pgsql-hackers@postgresql.org
Subject: Re: Patch: Implement failover on libpq connect level.
Date: Mon, 21 Dec 2015 17:18:37 +0300
Message-ID: <56780A3D.2090609@sigaev.ru> (raw)
In-Reply-To: <20151210075419.6c9b7ca4@wagnner.wagner.home>
References: <20150818041850.GA5092@wagner.pp.ru>
	<20151014104151.GA6744@wagner.pp.ru>
	<562E8C55.9030409@gmx.net>
	<20151028111839.6e73c68a@fafnir>
	<56327381.5040108@gmx.net>
	<CA+TgmoY8J2Jp1fM4EmtU6=3hHLpHc9+qyOJW3OgCNRN6QTgyDg@mail.gmail.com>
	<56379A44.9080609@gmx.net>
	<20151105151235.GA21434@wagner.pp.ru>
	<CA+TgmoYKvGsZGJB-cKU=xhHnq=b6XOM=qbseVC72HwH2+p5+TA@mail.gmail.com>
	<CAMsr+YGXTK3+i5zL3AkkR5BRP+Tw+f4+Ph=Z2_g7KD-nbb+cYg@mail.gmail.com>
	<20151106153807.GA6104@alvherre.pgsql>
	<CA+TgmoYYUeojjos=7ZT6Emkmri1f4n753tx9v7jEU-y28_8zOw@mail.gmail.com>
	<CAMsr+YHr740oGcVQcuyvLt1bwBPLQtpm5U-O+tTEFifBgHWdzw@mail.gmail.com>
	<20151109124404.1af6ba0c@fafnir>
	<5665EB79.9070805@enterprisedb.com>
	<20151210075419.6c9b7ca4@wagnner.wagner.home>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Sorry, but there is something wrong with your patch:
% patch -p1 -C < ~/Downloads/libpq-failover-5.patch
....
--------------------------
|diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
...
Hunk #18 succeeded at 2804.
patch: **** malformed patch at line 666: <<<<<<< BEGIN MERGE CONFLICT: local 
copy shown first <<<<<<<<<<<<<<<

Victor Wagner wrote:
> On Mon, 07 Dec 2015 15:26:33 -0500
> Korry Douglas <korry.douglas@enterprisedb.com> wrote:
>
>
>> The problem seems to be in PQconnectPoll() in the case for
>> CONNECTION_AUTH_OK, specifically this code:
>>
>>     /* We can release the address list now. */
>>     pg_freeaddrinfo_all(conn->addrlist_family, conn->addrlist);
>>     conn->addrlist = NULL;
>>     conn->addr_cur = NULL;
>> That frees up the list of alternative host addresses.  The state
>> machine then progresses to CONNECTION_CHECK_RO (which invokes
>> pg_is_in_recovery()), then CONNECTION_CHECK_RW (waiting for the
>
> Thank you for pointing to this problem. I've overlooked it. Probably
> I should improve my testing scenario.
>
> I', attaching new version of the patch, which, hopefully, handles
> address list freeing correctly.
>
>
>
>
>
>
>

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (165+ messages)  latest in thread

Message-ID: <56780A3D.2090609@sigaev.ru>
Permalink:  ../56780A3D.2090609@sigaev.ru/
Also on:    postgresql.org/message-id/56780A3D.2090609@sigaev.ru

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: teodor@sigaev.ru, vitus@wagner.pp.ru, pgsql-hackers@postgresql.org
  Subject: Re: Patch: Implement failover on libpq connect level.
  In-Reply-To: <56780A3D.2090609@sigaev.ru>
  References: <20150818041850.GA5092@wagner.pp.ru> <20151014104151.GA6744@wagner.pp.ru> <562E8C55.9030409@gmx.net> <20151028111839.6e73c68a@fafnir> <56327381.5040108@gmx.net> <CA+TgmoY8J2Jp1fM4EmtU6=3hHLpHc9+qyOJW3OgCNRN6QTgyDg@mail.gmail.com> <56379A44.9080609@gmx.net> <20151105151235.GA21434@wagner.pp.ru> <CA+TgmoYKvGsZGJB-cKU=xhHnq=b6XOM=qbseVC72HwH2+p5+TA@mail.gmail.com> <CAMsr+YGXTK3+i5zL3AkkR5BRP+Tw+f4+Ph=Z2_g7KD-nbb+cYg@mail.gmail.com> <20151106153807.GA6104@alvherre.pgsql> <CA+TgmoYYUeojjos=7ZT6Emkmri1f4n753tx9v7jEU-y28_8zOw@mail.gmail.com> <CAMsr+YHr740oGcVQcuyvLt1bwBPLQtpm5U-O+tTEFifBgHWdzw@mail.gmail.com> <20151109124404.1af6ba0c@fafnir> <5665EB79.9070805@enterprisedb.com> <20151210075419.6c9b7ca4@wagnner.wagner.home> <56780A3D.2090609@sigaev.ru>

* 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