pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Maxim Orlov <m.orlov@postgrespro.ru>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Sergei Kornilov <sk@zsrv.org>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: andres@anarazel.de, david@pgmasters.net, pgsql-hackers@postgresql.org, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Subject: Re: allow online change primary_conninfo
Date: Fri, 16 Oct 2020 19:50:01 +0300
Message-ID: <4cd4107ed423c8757636ec04342457bf@postgrespro.ru> (raw)
In-Reply-To: <20200327233911.GA30735@alvherre.pgsql>
References: <20200327233911.GA30735@alvherre.pgsql>

On 2020-03-28 02:39, Alvaro Herrera wrote:
> On 2020-Mar-27, Alvaro Herrera wrote:
> 
>> On 2020-Mar-27, Alvaro Herrera wrote:
>> 
>> > I pushed the wal_receiver_create_temp_slot bugfix, because I realized
>> > after looking for long enough at WalReceiverMain() that the code was
>> > beyond saving.  I'll be pushing the rest of this later today.
>> 
>> So here's the next one.  I still have to go over the doc changes here,
>> but at least the tests are passing for me.
> 
> Pushed with some documentation tweaks.
> 
> Many thanks for working on this!

Nice work! What do you think of possibility to add restore_command?

Is it a good idea to make a restore_command to be reloadable via SUGHUP 
too?

On the one hand it looks reasonable since primary_conninfo got such 
ability. On the other hand we don't exactly know whether the actual 
process after reload config would use "new" command or "old"  since it 
may take a long time to finish running old command (in case of scp or 
smth).

Also setting faulty restore_command lead to server termination, which is 
rather unexpectedly.
If anyone makes some minor typo in restore_command, say write 
restore_command='cp1 /mnt/srv/%f %p' instead of restore_command='cp 
/mnt/srv/%f %p' and do SELECT pg_reload_conf() then server will 
terminate.

Do you consider this feature useful? Any suggestions?

---
Best regards,
Maxim Orlov.

Attachments:

restore_command-sighup.patch (text/x-diff, 1.1K) download diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index a62d64eaa47..87fd5939246 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -3699,7 +3699,7 @@ static struct config_string ConfigureNamesString[] = }, { - {"restore_command", PGC_POSTMASTER, WAL_ARCHIVE_RECOVERY, + {"restore_command", PGC_SIGHUP, WAL_ARCHIVE_RECOVERY, gettext_noop("Sets the shell command that will be called to retrieve an archived WAL file."), NULL }, diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index 9cb571f7cc7..9c9091e601e 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -253,7 +253,6 @@ # placeholders: %p = path of file to restore # %f = file name only # e.g. 'cp /mnt/server/archivedir/%f %p' - # (change requires restart) #archive_cleanup_command = '' # command to execute at every restartpoint #recovery_end_command = '' # command to execute at completion of recovery

view thread (77+ messages)  latest in thread

Message-ID: <4cd4107ed423c8757636ec04342457bf@postgrespro.ru>
Permalink:  ../4cd4107ed423c8757636ec04342457bf@postgrespro.ru/
Also on:    postgresql.org/message-id/4cd4107ed423c8757636ec04342457bf@postgrespro.ru

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: m.orlov@postgrespro.ru, alvherre@2ndquadrant.com, sk@zsrv.org, michael@paquier.xyz, tomas.vondra@2ndquadrant.com, horikyota.ntt@gmail.com, peter.eisentraut@2ndquadrant.com
  Subject: Re: allow online change primary_conninfo
  In-Reply-To: <4cd4107ed423c8757636ec04342457bf@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox