Invalidate acl.c caches for pg_authid.rolinherit changes

From: Noah Misch <noah(at)leadboat(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Invalidate acl.c caches for pg_authid.rolinherit changes
Date: 2020-12-21 09:50:28
Message-ID: 20201221095028.GB3777719@rfd.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Backends reflect "GRANT role_name" changes rather quickly, due to a syscache
invalidation callback. Let's register an additional callback to reflect
"ALTER ROLE ... [NO]INHERIT" with equal speed. I propose to back-patch this.
While pg_authid changes may be more frequent than pg_auth_members changes, I
expect neither is frequent enough to worry about the resulting acl.c cache
miss rate.

pg_authid changes don't affect cached_membership_roles, so I could have
invalidated cached_privs_roles only. That felt like needless complexity. I
expect cached_privs_role gets the bulk of traffic, since SELECT, INSERT,
UPDATE and DELETE use it. cached_membership_roles pertains to DDL and such.

Attachment Content-Type Size
noinherit-inval-v1.patch text/plain 2.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Konstantin Knizhnik 2020-12-21 10:06:43 Re: On login trigger: take three
Previous Message Peter Smith 2020-12-21 09:47:00 Re: Single transaction in the tablesync worker?