Re: [PATCH] Expose port->authn_id to extensions and triggers - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [PATCH] Expose port->authn_id to extensions and triggers
Date
Msg-id 20220324181935.qrvomqq24ugj7hgf@alap3.anarazel.de
Whole thread Raw
In response to Re: [PATCH] Expose port->authn_id to extensions and triggers  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hi,

On 2022-03-24 13:55:29 -0400, Robert Haas wrote:
> On Wed, Mar 2, 2022 at 4:27 PM Andres Freund <andres@anarazel.de> wrote:
> > I don't think we should commit this without synchronizing the authn between
> > worker / leader (in a separate commit). Too likely that some function that's
> > marked parallel ok queries the authn_id, opening up a security/monitoring hole
> > or such because of a bogus return value.
>
> It is not free to copy data from the leader to the worker. I don't
> think we should just adopt a policy of copying everything anyone
> thinks of, because then most of the time we'll be copying a bunch of
> stuff that really isn't needed.

I agree.


> My gut reaction is to think that this is way too marginal to be worth
> making parallel-safe, but it is also possible that I just don't know
> enough to understand its true value.

My problem with that is that as far as I can tell the only real use of the
field / function is for stuff like audit logging, RLS etc. Which seems
problematic for two reasons:

1) It's likely that the call to the function is nested into other functions,
   "hiding" the parallel safety. Then it'd return bogus data silently. At
   the very least we need to make it error out if called in a parallel worker.
2) If used for the purposes above, there's basically no parallelism possible
   anymore.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] WIP aPatch: Pgbench Serialization and deadlock errors
Next
From: Dagfinn Ilmari Mannsåker
Date:
Subject: Doc patch: replace 'salesmen' with 'salespeople'