mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
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
This commit is contained in:
@ -482,6 +482,10 @@ extern bool has_rolreplication(Oid roleid);
|
||||
typedef void (*shmem_request_hook_type) (void);
|
||||
extern PGDLLIMPORT shmem_request_hook_type shmem_request_hook;
|
||||
|
||||
extern Size EstimateClientConnectionInfoSpace(void);
|
||||
extern void SerializeClientConnectionInfo(Size maxsize, char *start_address);
|
||||
extern void RestoreClientConnectionInfo(char *conninfo);
|
||||
|
||||
/* in executor/nodeHash.c */
|
||||
extern size_t get_hash_memory_limit(void);
|
||||
|
||||
|
Reference in New Issue
Block a user