Re: [HACKERS] pg_basebackup behavior on non-existent slot - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: [HACKERS] pg_basebackup behavior on non-existent slot
Date
Msg-id CABUevExQnM4ERa0yzR9CfjncNd5yuLsKOkM_U++JSShmRHX77A@mail.gmail.com
Whole thread Raw
In response to [HACKERS] pg_basebackup behavior on non-existent slot  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: [HACKERS] pg_basebackup behavior on non-existent slot
List pgsql-hackers
On Mon, Sep 4, 2017 at 3:21 PM, Jeff Janes <jeff.janes@gmail.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.

--

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [HACKERS] [Proposal] Allow users to specify multiple tables inVACUUM commands
Next
From: Amit Langote
Date:
Subject: Re: [HACKERS] Copyright in partition.h and partition.c