Thread: Query on Primary_conninfo

Query on Primary_conninfo

From
Praneel Devisetty
Date:
Hi, 

I have a postgresql cluster running on 13.9.13 and standby has primary_connfino as below

host=kabc03-dev01-ins06-pgs54-dbs-asy.int.dev.example.com port=5432 user=pubuser_1 passfile='/home/postgres/.pgpass' application_name=dr_node1

hostname keng03-dev01-ins06-wfm54-dbs-asy.int.dev.example.com is internally mapped to a fqdn, say node1. When  a failover occurs hostname  is mapped to node2(new master) post failover via a script.

Standy is not picking this change even after a reload.

Restarting standby is working out, but as PG13 supports reload of primary_connfino is there a reliable way to achieve this without restarting standby database.

Thanks 
Praneel


Re: Query on Primary_conninfo

From
Michael Paquier
Date:
On Wed, Jul 26, 2023 at 05:33:50PM +0530, Praneel Devisetty wrote:
> Standy is not picking this change even after a reload.
>
> Restarting standby is working out, but as PG13 supports reload of
> primary_connfino is there a reliable way to achieve this without restarting
> standby database.

primary_conninfo should be able to switch dynamically the upstream
server it streams WAL from on a reload.  I've quickly checked with a
simple configuration and I was able to get it done without a restart
here.  Perhaps you have found a bug, but it's hard to say without
having more details about what's happening.  For example, what do the
logs of the standby tell you?  Are you sure that the reload was done
on the correct node?  Did you check with a SHOW command that the new
value is reflected on your standby to what you want it to be?
--
Michael

Attachment