Re: Wait for parallel workers to attach - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Wait for parallel workers to attach
Date
Msg-id CAA4eK1LVB3VF1zQKvThkg0JSaayMU9bvycN2-jYKXnpq0ACJeg@mail.gmail.com
Whole thread Raw
In response to Re: Wait for parallel workers to attach  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Wait for parallel workers to attach  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Wed, Jan 31, 2018 at 9:53 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Wed, Jan 31, 2018 at 3:57 AM, Amit Kapila <amit.kapila16@gmail.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,
>

Okay, no problem.

> which also works over the comments fairly heavily.
>

+ * However, if the leader needs to wait for
+ * all of its workers or for a specific worker, it may want to call this
+ * function before doing so.

I think suggesting to use this API to wait "for a specific worker"
doesn't seem like a good idea as it doesn't have any such provision.
Other than that the patch looks good.

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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: CURRENT OF causes an error when IndexOnlyScan is used
Next
From: Amit Kapila
Date:
Subject: Re: [HACKERS] why not parallel seq scan for slow functions