Re: Parallel worker error

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parallel worker error
Date: 2017-09-04 09:46:28
Views: Raw Message | Whole Thread | Download mbox
Lists: pgsql-hackers

On Sat, Sep 2, 2017 at 12:21 PM, Noah Misch <noah(at)leadboat(dot)com> wrote:
> On Thu, Aug 31, 2017 at 03:11:10PM -0400, Robert Haas wrote:
>> On Wed, Aug 30, 2017 at 11:19 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> > But since that's an established design fl^H^Hprinciple, maybe that
>> > means we should go with the approach of teaching SerializeGUCState()
>> > to ignore role altogether and instead have ParallelWorkerMain call
>> > SetCurrentRoleId using information passed via the FixedParallelState
>> > (not sure of the precise details here).
>> Could I get some opinions on the virtues of this approach, vs. any of
>> the other suggestions at or near
>> ?
> It seems good to me, better than the other options in that mail.

It seems like the consensus is to move forward with this approach. I
have written a patch implementing the above idea. Note, that to use
SetCurrentRoleId, we need the value of guc "is_superuser" for the
current user and we don't pass this value to parallel workers as this
is PGC_INTERNAL guc variable. So, I have passed this value via

After this patch, I think the check of InitializingParallelWorker in
check_role function is redundant. I have prepared a separate patch
for it, but may be it can be handled with the main patch to fix the

With Regards,
Amit Kapila.

Attachment Content-Type Size
fix_role_handling_parallel_worker_v1.patch application/octet-stream 5.6 KB
remove_redundant_check_from_check_role_v1.patch application/octet-stream 804 bytes

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2017-09-04 09:57:20 Re: [PATCH] Improve geometric types
Previous Message Andreas Joseph Krogh 2017-09-04 09:34:28 Re: Release Note changes