Re: Wait for parallel workers to attach

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Subject: Re: Wait for parallel workers to attach
Date: 2018-01-31 16:23:02
Message-ID: CA+TgmoYUZWD12cNXhAunoDBWeU4BfM-U5GjrZVkngLUoqUBHyA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 31, 2018 at 3:57 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>> * There might be some opportunity to share some of the new code with
>> the code recently committed to WaitForParallelWorkersToFinish(). For
>> one thing, the logic in this block could be refactored into a
>> dedicated function that is called by both
>> WaitForParallelWorkersToAttach() and WaitForParallelWorkersToFinish():
>
> I had thought about this earlier but left it as the common code was
> too less, however as you have pointed out, I had extracted the common
> code into a separate function.

I like it better the other way, so I've changed it back in the
attached version, which also works over the comments fairly heavily.

> I think we should not touch anything related to Gather (merge) as they
> don't need it for the purpose of correctness. However, we might want
> to improve them by using this new API at a certain point if the need
> arises. I guess we can use this API to detect failures early.

I added a comment in this version explaining why it works, so that we
don't forget (again). If we decide to change it in the future then we
can remove or update the comment.

Another thing I did was known_started_workers ->
known_attached_workers, which I think is more precisely correct.

Please let me know your thoughts about this version. If it looks OK,
I'll commit it.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment Content-Type Size
wait-for-attach-rmh.patch application/octet-stream 9.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo Nagata 2018-01-31 16:33:49 CURRENT OF causes an error when IndexOnlyScan is used
Previous Message Peter Eisentraut 2018-01-31 15:22:25 Re: JIT compiling with LLVM v9.0