Re: Patch: Implement failover on libpq connect level.

From: Thom Brown <thom(at)linux(dot)com>
To: Victor Wagner <vitus(at)wagner(dot)pp(dot)ru>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Implement failover on libpq connect level.
Date: 2016-01-23 04:23:30
Message-ID: CAA-aLv6wtKY1tdT23TS8_FdS8E08j6wc5KSE3EB0zfDyHp7rQA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

On 23 January 2016 at 03:32, Thom Brown <thom(at)linux(dot)com> wrote:
> On 22 January 2016 at 19:30, Victor Wagner <vitus(at)wagner(dot)pp(dot)ru> wrote:
>> On Tue, 19 Jan 2016 14:34:54 +0000
>> Thom Brown <thom(at)linux(dot)com> wrote:
>>
>>>
>>> The segfault issue I originally reported now appears to be resolved.
>>>
>>> But now I have another one:
>>>
>>> psql
>>> 'postgresql://thom(at)127(dot)0(dot)0(dot)1:5530,127.0.0.1:5531,127.0.0.1:5532,127.0.0.1:5533/postgres?hostorder=random&readonly=1&failover_timeout=5'
>>> -c 'show port'
>>
>> Here is new version of the patch. Now I've reworked hostorder=random and
>> it seems to work as well as sequential. failover_timeout works too.
>> I've also found a case when attempt to connect fail when receiving
>> FATAL message from server which is not properly up yet. So, it is fixed
>> too.
>>
>> Addititonally, error messages from all failed connect attempts are not
>> accumulated now. Only last one is returned.
>
> I can't connect to a standby with the patch applied:
>
> thom(at)swift:~/Development/test$ psql -p 5531 postgres
> psql: thom(at)swift:~/Development/test$
>
> No error message, nothing in the logs. I find this is the case with
> any standby, but doesn't affect primaries.
>
> So this has broken existing functionality somewhere.

Okay, I've tested my original complaints, and they appear to be
resolved. The timeout works fine, the sequential and random orders
behave as expected, and the readonly setting is also working.

Thom

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jinhua Luo 2016-01-23 06:43:40 insert/update performance
Previous Message Thom Brown 2016-01-23 03:32:26 Re: Patch: Implement failover on libpq connect level.

Browse pgsql-jdbc by date

  From Date Subject
Next Message Victor Wagner 2016-01-24 09:18:32 Re: Patch: Implement failover on libpq connect level.
Previous Message Thom Brown 2016-01-23 03:32:26 Re: Patch: Implement failover on libpq connect level.