Re: Cache invalidation after authentication (on-the-fly role creation)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Cache invalidation after authentication (on-the-fly role creation)
Date: 2018-07-04 21:35:05
Message-ID: 67543.1530740105@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com> writes:
> I'd like to do this to postinit.c:

> PerformAuthentication(MyProcPort);
> + AcceptInvalidationMessages();
> InitializeSessionUserId(username, useroid);

> Any objections?

That seems like a *really* ad-hoc place to put it. Why should it be
there, and not (say) somewhere inside InitializeSessionUserId, or maybe
(also?) inside PerformAuthentication? Why do the existing call sites for
AcceptInvalidationMessages --- in particular, the ones associated with
lock acquisition --- not solve the problem already?

I'm not opposed to trying to make things better if we have a stale-cache
problem during init, just dubious that this is how to do it.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2018-07-04 22:09:09 setproctitle_fast()
Previous Message David G. Johnston 2018-07-04 21:33:05 Re: Unexpected behavior of DROP VIEW/TABLE IF EXISTS