Re: Libpq support to connect to standby server as priority

Haribabu Kommi <kommi.haribabu@gmail.com>

From: Haribabu Kommi <kommi.haribabu@gmail.com>
To: "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>, Tom Lane <tgl@sss.pgh.pa.us>, Dave Cramer <pg@fastcrypt.com>, Robert Haas <robertmhaas@gmail.com>, Jing Wang <jingwangian@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2019-02-22T07:49:55Z
Lists: pgsql-hackers
On Fri, Feb 22, 2019 at 5:47 PM Tsunakawa, Takayuki <
tsunakawa.takay@jp.fujitsu.com> wrote:

> From: Haribabu Kommi [mailto:kommi.haribabu@gmail.com]
> Here I attached first set of patches that implemented the prefer-read
> option
> > after reporting the transaction_read_only GUC to client. Along the lines
> > of adding prefer-read option patch,
>
> Great, thank you!  I'll review and test it.
>

Thanks.


> > 3. Existing read-write code is modified to use the new reported GUC
> instead
> > of executing the show command.
>
> Is the code path left to use SHOW for older servers?
>

Yes, for older versions less than 12, still uses the SHOW command approach.

Regards,
Haribabu Kommi
Fujitsu Australia

Commits

  1. Make test_target_session_attrs more robust against connection failure.

  2. Extend the abilities of libpq's target_session_attrs parameter.

  3. Mark default_transaction_read_only as GUC_REPORT.

  4. Introduce a new GUC_REPORT setting "in_hot_standby".

  5. Avoid spamming the client with multiple ParameterStatus messages.

  6. Avoid harmless Valgrind no-buffer-pin errors.

  7. Restructure libpq code to remove some duplicity

  8. libpq: Add target_session_attrs parameter.