Re: [HACKERS] parallel.c oblivion of worker-startup failures
Thomas Munro <thomas.munro@enterprisedb.com>
From: Thomas Munro <thomas.munro@enterprisedb.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>,
Michael Paquier <michael.paquier@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2018-01-24T05:02:45Z
Lists: pgsql-hackers
On Wed, Jan 24, 2018 at 5:43 PM, Amit Kapila <amit.kapila16@gmail.com> wrote: >> Hmm. Yeah. I can't seem to reach a stuck case and was probably just >> confused and managed to confuse Robert too. If you make >> fork_process() fail randomly (see attached), I see that there are a >> couple of easily reachable failure modes (example session at bottom of >> message): >> > > In short, we are good with committed code. Right? Yep. Sorry for the noise. > Yes, this is what I am trying to explain on parallel create index > thread. I think there we need to either use > WaitForParallelWorkersToFinish or WaitForParallelWorkersToAttach (a > new API as proposed in that thread) if we don't want to use barriers. > I see a minor disadvantage in using WaitForParallelWorkersToFinish > which I will say on that thread. Ah, I see. So if you wait for them to attach you can detect unexpected dead workers (via shm_mq_receive), at the cost of having the leader wasting time waiting around for forked processes to say hello when it could instead be sorting tuples. -- Thomas Munro http://www.enterprisedb.com
Commits
-
Report an ERROR if a parallel worker fails to start properly.
- 2843c01a56eb 9.6.7 landed
- 383e4268ff8c 10.2 landed
- 2badb5afb89c 11.0 landed
-
Report failure to start a background worker.
- facd94e72f27 9.4.16 landed
- 0426a77ce465 9.5.11 landed
- b75644066091 9.6.7 landed
- a8ef4e81e6f2 10.2 landed
- 28724fd90d2f 11.0 landed