Re: [EXTERNAL] Support load balancing in libpq

Daniel Gustafsson <daniel@yesql.se>

From: Daniel Gustafsson <daniel@yesql.se>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, Jelte Fennema <postgres@jeltef.nl>, Tatsuo Ishii <ishii@sraoss.co.jp>, "Gregory Stark (as CFM)" <stark.cfm@gmail.com>, Andrey Borodin <amborodin86@gmail.com>, Jacob Champion <jchampion@timescale.com>, Maxim Orlov <orlovmg@gmail.com>, Jelte Fennema <Jelte.Fennema@microsoft.com>, "mbanck@gmx.net" <mbanck@gmx.net>, "aleksander@timescale.com" <aleksander@timescale.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, "andres@anarazel.de" <andres@anarazel.de>
Date: 2023-03-30T08:21:56Z
Lists: pgsql-hackers
> On 30 Mar 2023, at 10:00, Julien Rouhaud <rjuju123@gmail.com> wrote:
> 
> On Thu, Mar 30, 2023 at 3:03 PM Daniel Gustafsson <daniel@yesql.se> wrote:
>> 
>>> On 30 Mar 2023, at 03:48, Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com> wrote:
>> 
>>> While checking the buildfarm, I found a failure on NetBSD caused by the added code[1]:
>> 
>> Thanks for reporting, I see that lapwing which runs Linux (Debian 7, gcc 4.7.2)
>> has the same error.  I'll look into it today to get a fix committed.
> 
> This is an i686 machine, so it probably has the same void *
> difference.  Building with -m32 might be enough to reproduce the
> problem.

Makes sense.  I think the best option is to simply remove conn from being part
of the seed and rely on the other values.  Will apply that after a testrun.

--
Daniel Gustafsson




Commits

  1. Fix pointer cast for seed calculation on 32-bit systems

  2. Copy and store addrinfo in libpq-owned private memory

  3. libpq: Use modern socket flags, if available.