Re: Parallel worker error

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Noah Misch <noah(at)leadboat(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-09 02:26:39
Message-ID: CAA4eK1J2mxpRObUtG2=HJfSinDHkdF4Qen-qFmmAxkrX3tq-xg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

On Fri, Sep 8, 2017 at 3:13 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Fri, Sep 8, 2017 at 1:17 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>> You are right. I have changed the ordering and passed OuterUserId via
>> FixedParallelState.
>
> This looks a little strange:
>
> + SetCurrentRoleId(fps->outer_user_id, fps->is_current_user_superuser);
>
> The first argument says "outer" but the second says "current". I'm
> wondering if we can just make the second one is_superuser.
>

No issues changed as per suggestion.

> I'm also wondering if, rather than using GetConfigOptionByName, we
> should just make the GUC underlying is_superuser non-static and use
> the value directly. If not, then I'm alternatively wondering whether
> we should maybe use a less-generic name than varval.
>

I think we can go either way. So prepared patches with both
approaches. In fix_role_handling_parallel_worker_v3_1.patch, I have
changed the variable name and in
fix_role_handling_parallel_worker_v3_2.patch, I have exposed the guc
is_superuser.

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

Attachment Content-Type Size
fix_role_handling_parallel_worker_v3_1.patch application/octet-stream 5.7 KB
fix_role_handling_parallel_worker_v3_2.patch application/octet-stream 6.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-09-09 02:32:03 Still another race condition in recovery TAP tests
Previous Message Thomas Munro 2017-09-09 01:34:48 Re: More flexible LDAP auth search filters?