Re: pg_basebackup behavior on non-existent slot

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_basebackup behavior on non-existent slot
Date: 2017-09-05 23:25:59
Message-ID: CABUevExQnM4ERa0yzR9CfjncNd5yuLsKOkM_U++JSShmRHX77A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 4, 2017 at 3:21 PM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:

>
> If I tell pg_basebackup to use a non-existent slot, it immediately reports
> an error. And then it exits with an error, but only after streaming the
> entire database contents.
>
> If you are doing this interactively and are on the ball, of course, you
> can hit ctrl-C when you see the error message.
>
> I don't know if this is exactly a bug, but it seems rather unfortunate.
>

I think that should qualify as a bug.

In 10 it will automatically create a transient slot in this case, but there
might still be a case where you can provoke this.

> Should the parent process of pg_basebackup be made to respond to SIGCHLD?
> Or call waitpid(bgchild, &status, WNOHANG) in some strategic loop?
>

I think it's ok to just call waitpid() -- we don't need to react super
quickly, but we should react. And we should then exit the main process with
an error before actually streaming everything.

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2017-09-06 00:56:13 Re: Copyright in partition.h and partition.c
Previous Message Michael Paquier 2017-09-05 22:53:50 Re: [Proposal] Allow users to specify multiple tables in VACUUM commands