Re: Support load balancing in libpq - Mailing list pgsql-hackers

From Jelte Fennema
Subject Re: Support load balancing in libpq
Date
Msg-id DB7PR83MB0284A1221D88982A38B22310F78B9@DB7PR83MB0284.EURPRD83.prod.outlook.com
Whole thread Raw
In response to RE: Support load balancing in libpq  ("kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>)
Responses RE: Support load balancing in libpq
List 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. 

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns
Next
From: Stephen Frost
Date:
Subject: Re: Add function to return backup_label and tablespace_map