Re: Support load balancing in libpq
Jelte Fennema-Nio <jelte.fennema@microsoft.com>
From: Jelte Fennema <Jelte.Fennema@microsoft.com>
To: "kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2022-07-15T14:59:55Z
Lists: pgsql-hackers
> we can assume that one of members is a primary and others are secondary. With plain Postgres this assumption is probably correct. But the main reason I'm interested in this patch was because I would like to be able to load balance across the workers in a Citus cluster. These workers are all primaries. Similar usage would likely be possible with BDR (bidirectional replication). > In this case user maybe add a primary host to top of the list, > so sorting may increase time durations for establishing connection. If the user takes such care when building their host list, they could simply not add the load_balance_hosts=true option to the connection string. If you know there's only one primary in the list and you're looking for the primary, then there's no reason to use load_balance_hosts=true.
Commits
-
Fix pointer cast for seed calculation on 32-bit systems
- 2fe7a6df94e6 16.0 landed
-
Copy and store addrinfo in libpq-owned private memory
- 44d85ba5a336 16.0 landed
-
libpq: Use modern socket flags, if available.
- bfc9497ece01 16.0 cited