Re: Patch: Implement failover on libpq connect level. - Mailing list pgsql-hackers

From Victor Wagner
Subject Re: Patch: Implement failover on libpq connect level.
Date
Msg-id 20151210075419.6c9b7ca4@wagnner.wagner.home
Whole thread Raw
In response to Re: Patch: Implement failover on libpq connect level.  (Korry Douglas <korry.douglas@enterprisedb.com>)
Responses Re: Patch: Implement failover on libpq connect level.  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-hackers
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.




--
                                   Victor Wagner <vitus@wagner.pp.ru>

Attachment

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: Passing initially_valid values instead of !skip_validation to StoreRelCheck() in AddRelationNewConstraints()
Next
From: amul sul
Date:
Subject: Re: Passing initially_valid values instead of !skip_validation to StoreRelCheck() in AddRelationNewConstraints()