Re: [PATCH] Report exit code from external recovery commands properly

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Report exit code from external recovery commands properly
Date: 2013-12-03 02:23:39
Message-ID: 1386037419.26167.1.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 2013-11-30 at 15:56 -0800, Peter Geoghegan wrote:
> On Sun, Nov 24, 2013 at 5:11 AM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> > How about this?
>
> Hmm. You say:
>
> + If the command returns a nonzero exit status then a warning log
> + message will be written. An exception is that if the command was
> + terminated by a signal or an error by the shell (such as command not
> + found), a fatal error will be raised.
>
> But in the case of the archiver, in contrast to the startup process,
> this isn't really a big deal. It'll just pick up where it left off.
> Whereas the reaper code shuts down the system if this happens in the
> startup process. In my opinion that's a distinction that bears
> emphasizing.

That snippet you quote is about archive_cleanup_command. My patch
doesn't touch archive_command at all.

The current documentation about archive_command contains

<para>
It is important that the archive command return zero exit status if and
only if it succeeds. Upon getting a zero result,
<productname>PostgreSQL</> will assume that the file has been
successfully archived, and will remove or recycle it. However, a nonzero
status tells <productname>PostgreSQL</> that the file was not archived;
it will try again periodically until it succeeds.
</para>

which I think addresses your point.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2013-12-03 02:25:12 Re: Trust intermediate CA for client certificates
Previous Message Tom Dunstan 2013-12-03 02:18:20 Re: Extension Templates S03E11