|From:||Chapman Flack <chap(at)anastigmatix(dot)net>|
|To:||PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>|
|Subject:||archive restore command failure status [was Re: patch proposal]|
|Views:||Raw Message | Whole Thread | Download mbox | Resend email|
>On 16 August 2016 at 09:06, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
>> From PG's perspective,
>> your restore command has said that all of the WAL has been replayed.
>> If that's not what you want then change your restore command to
>> return an exit code > 125, which tells PG that it's unable to restore
>> that WAL segment.
> Ah! Is this documented somewhere?
> if we expect people to use correct exit codes we should document them,
It seems to be set out clearly in the code comments, but only alluded
to in the "Recovering using a continuous archive backup" doc section.
It looks like the code was put there to cover the case where certain
unanticipated Bad Things happen (a signal, or one of the Single Unix
Spec reserved codes 126 or 127 when the shell couldn't do what you`
asked it to), but not necessarily with an eye to the possibility you
might /want/ to make recovery abort based on a condition your restore
script detects, and that's why the doc only mentions an exception
on termination by a signal or an error by the shell, but doesn't
emphasize how you could do this yourself (by exit 126 or 127, or
sending yourself a signal).
Maybe that is worth a brief mention? It doesn't seem outlandish to me
that a restore script could detect conditions worth stopping recovery
|Next Message||Amit Langote||2017-12-22 04:25:30||Re: [HACKERS] path toward faster partition pruning|
|Previous Message||John Naylor||2017-12-22 04:16:02||Re: WIP: a way forward on bootstrap data|