Re: [HACKERS] parallel.c oblivion of worker-startup failures - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: [HACKERS] parallel.c oblivion of worker-startup failures
Date
Msg-id CAH2-Wz=+tXXopjSFc6Sg1WZngDGrdGXsv9w8qK1bwK65bzMx-g@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] parallel.c oblivion of worker-startup failures  (Thomas Munro <thomas.munro@enterprisedb.com>)
Responses Re: [HACKERS] parallel.c oblivion of worker-startup failures
List pgsql-hackers
On Tue, Jan 23, 2018 at 9:02 PM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:
>> 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.

The leader can go ahead and sort before calling something like a new
WaitForParallelWorkersToAttach() function (or even
WaitForParallelWorkersToFinish()). If we did add a
WaitForParallelWorkersToAttach() function, then the performance hit
would probably not be noticeable in practice. The
parallel_leader_participates case would still work without special
care (that's the main hazard that makes using a barrier seem
unappealing).

-- 
Peter Geoghegan


pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)
Next
From: Mithun Cy
Date:
Subject: Re: Possible performance regression in version 10.1 with pgbenchread-write tests.