Re: allow online change primary_conninfo - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: allow online change primary_conninfo
Date
Msg-id 20200326000812.GA18798@alvherre.pgsql
Whole thread Raw
In response to Re: allow online change primary_conninfo  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: allow online change primary_conninfo  (Michael Paquier <michael@paquier.xyz>)
Re: allow online change primary_conninfo  (Sergei Kornilov <sk@zsrv.org>)
List pgsql-hackers
On 2020-Mar-24, Alvaro Herrera wrote:

> I think the startup sighup handler should be in startup.c, not xlog.c,
> which has enough random code already.  We can add an accessor in xlog.c
> to let changing the walrcv status flag, to be called from the signal
> handler.

... as in the attached version.

Sergei included LOG messages to indicate which setting has been changed.
I put these in "#if 0" for now, but I'm thinking to remove these
altogether; we already have LOG messages when a setting changes value,
per ProcessConfigFileInternal(); the log sequence looks like this, taken
from tmp_check/log/001_stream_rep_standby_2.log after running the tests:

2020-03-25 20:54:19.413 -03 [17493] LOG:  received SIGHUP, reloading configuration files
2020-03-25 20:54:19.415 -03 [17493] LOG:  parameter "primary_slot_name" changed to "standby_2"
2020-03-25 20:54:19.415 -03 [17493] LOG:  parameter "wal_receiver_status_interval" changed to "1"
2020-03-25 20:54:19.422 -03 [17569] LOG:  started streaming WAL from primary at 0/3000000 on timeline 1
2020-03-25 20:54:19.426 -03 [17494] LOG:  wal receiver process shutdown requested
2020-03-25 20:54:19.426 -03 [17569] FATAL:  terminating walreceiver process due to administrator command
2020-03-25 20:54:19.433 -03 [17572] LOG:  started streaming WAL from primary at 0/3000000 on timeline 1

which looks sufficient.  Maybe we can reword that new message, say "wal
receiver process shutdown forced by parameter change".  Not sure if we
can or should adjust the FATAL line; probably not worth the trouble.

Thoughts welcome.  I'm thinking on getting this applied shortly.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: plan cache overhead on plpgsql expression
Next
From: Jeff Davis
Date:
Subject: Re: AllocSetEstimateChunkSpace()