Re: [HACKERS] pg_basebackup behavior on non-existent slot

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Re: [HACKERS] pg_basebackup behavior on non-existent slot
Дата
Msg-id CAMkU=1xuF8mT30P+3CCx9iMpGpQgxSQpCDx2vgb-YFcHkhxNEw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] pg_basebackup behavior on non-existent slot  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Ответы Re: [HACKERS] pg_basebackup behavior on non-existent slot  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-hackers
On Wed, Sep 6, 2017 at 2:50 AM, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
Magnus Hagander wrote:
> On Mon, Sep 4, 2017 at 3:21 PM, Jeff Janes <jeff.janes@gmail.com> wrote:

> > 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.

Hmm, not sure about that ... in the normal case (slotname is correct)
you'd be doing thousands of useless waitpid() system calls during the
whole operation, no?  I think it'd be better to have a SIGCHLD handler
that sets a flag (just once), which can be quickly checked without
accessing kernel space.

If we don't want polling by waitpid, then my next thought would be to move the data copy into another process, then have the main process do nothing but wait for the first child to exit.  If the first to exit is the WAL receiver, then we must have an error and the data receiver can be killed.  I don't know how to translate that to Windows, however.

Cheers,

Jeff

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Emre Hasegeli
Дата:
Сообщение: Re: [HACKERS] [PATCH] Improve geometric types
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] domain type smashing is expensive