Re: [HACKERS] parallel.c oblivion of worker-startup failures

Amit Kapila <amit.kapila16@gmail.com>

From: Amit Kapila <amit.kapila16@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Michael Paquier <michael.paquier@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2017-12-12T03:30:08Z
Lists: pgsql-hackers

Attachments

On Mon, Dec 11, 2017 at 11:27 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Sun, Dec 10, 2017 at 11:07 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
>> Okay, see the attached and let me know if that suffices the need?
>
> +             * Check for unexpected worker death.  This will ensure that if
> +             * the postmaster failed to start the worker, then we don't wait
> +             * for it indefinitely.  For workers that are known to be
> +             * launched, we can rely on their error queue being freed once
> +             * they exit.
>
> Hmm.  Is this really true?  What if the worker starts up but then
> crashes before attaching to the error queue?
>

If the worker errored out before attaching to the error queue, then we
can't rely on error queue being freed.  However, in that case, the
worker status will be BGWH_STOPPED.  I have adjusted the comment
accordingly.

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

Commits

  1. Report an ERROR if a parallel worker fails to start properly.

  2. Report failure to start a background worker.