pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow parallel workers to retrieve some data from Port
Date: Wed, 24 Aug 2022 03:57:38 +0000
Message-ID: <E1oQhWL-000wIW-MC@gemulon.postgresql.org> (raw)

Allow parallel workers to retrieve some data from Port

This commit moves authn_id into a new global structure called
ClientConnectionInfo (mapping to a MyClientConnectionInfo for each
backend) which is intended to hold all the client information that
should be shared between the backend and any of its parallel workers,
access for extensions and triggers being the primary use case.  There is
no need to push all the data of Port to the workers, and authn_id is
quite a generic concept so using a separate structure provides the best
balance (the name of the structure has been suggested by Robert Haas).

While on it, and per discussion as this would be useful for a potential
SYSTEM_USER that can be accessed through parallel workers, a second
field is added for the authentication method, copied directly from
Port.

ClientConnectionInfo is serialized and restored using a new parallel
key and a structure tracks the length of the authn_id, making the
addition of more fields straight-forward.

Author: Jacob Champion
Reviewed-by: Bertrand Drouvot, Stephen Frost, Robert Haas, Tom Lane,
Michael Paquier, Julien Rouhaud
Discussion: https://postgr.es/m/793d990837ae5c06a558d58d62de9378ab525d83.camel@vmware.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d951052a9e02bfacad8bd6f0f53a4dcd3b7e6d1f

Modified Files
--------------
src/backend/access/transam/parallel.c | 19 ++++++-
src/backend/libpq/auth.c              | 23 +++++----
src/backend/postmaster/postmaster.c   |  1 +
src/backend/utils/init/miscinit.c     | 93 +++++++++++++++++++++++++++++++++++
src/include/libpq/libpq-be.h          | 45 ++++++++++++-----
src/include/miscadmin.h               |  4 ++
src/tools/pgindent/typedefs.list      |  2 +
7 files changed, 163 insertions(+), 24 deletions(-)



Message-ID: <E1oQhWL-000wIW-MC@gemulon.postgresql.org>
Permalink:  ../E1oQhWL-000wIW-MC@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oQhWL-000wIW-MC@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Allow parallel workers to retrieve some data from Port
  In-Reply-To: <E1oQhWL-000wIW-MC@gemulon.postgresql.org>
  References: <E1oQhWL-000wIW-MC@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox