Re: Patch: Implement failover on libpq connect level.

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Mithun Cy <mithun(dot)cy(at)enterprisedb(dot)com>
Cc: Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>, Catalin Iacob <iacobcatalin(at)gmail(dot)com>, "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>, Peter van Hardenberg <pvh(at)pvh(dot)ca>, Peter Eisentraut <peter_e(at)gmx(dot)net>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Implement failover on libpq connect level.
Date: 2016-12-05 19:12:26
Message-ID: CA+TgmoZCq4Ee7dM8+8yELConeU4PSK84XC0KGGaoCXnYW0f7OQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

On Mon, Dec 5, 2016 at 1:59 PM, Mithun Cy <mithun(dot)cy(at)enterprisedb(dot)com> wrote:
> On Mon, Dec 5, 2016 at 11:23 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>I think that you need a restoreErrorMessage call here:
>> /* Skip any remaining addresses for this host. */
>> conn->addr_cur = NULL;
>> if (conn->whichhost + 1 < conn->nconnhost)
>> {
>> conn->status = CONNECTION_NEEDED
>> restoreErrorMessage(conn, &savedMessage);
>> goto keep_going;
>> }
>
> Right after seeing transaction is read-only we have restored the saved
> message so I think we do not need one more restore there.
> if (strncmp(val, "on", 2) == 0)
> {
> PQclear(res);
> + restoreErrorMessage(conn, &savedMessage);

D'oh! You're correct, of course.

Committed without that.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-12-05 19:32:40 Re: [COMMITTERS] pgsql: Introduce dynamic shared memory areas.
Previous Message Robert Haas 2016-12-05 19:06:29 Re: [COMMITTERS] pgsql: Introduce dynamic shared memory areas.

Browse pgsql-jdbc by date

  From Date Subject
Next Message Rodrigo Garcia 2016-12-07 02:40:58 Unexpected transaction behaviour
Previous Message Mithun Cy 2016-12-05 18:59:47 Re: Patch: Implement failover on libpq connect level.