mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-01 15:11:18 +02:00
process startup: Do InitProcess() at the same time regardless of EXEC_BACKEND.
An upcoming patch splits single user mode into its own function. This makes that easier. Split out for easier review / testing. Reviewed-By: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Author: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/20210802164124.ufo5buo4apl6yuvs@alap3.anarazel.de
This commit is contained in:
parent
37a9aa6591
commit
3d7c752a2f
@ -4275,6 +4275,15 @@ BackendStartup(Port *port)
|
|||||||
/* Perform additional initialization and collect startup packet */
|
/* Perform additional initialization and collect startup packet */
|
||||||
BackendInitialize(port);
|
BackendInitialize(port);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Create a per-backend PGPROC struct in shared memory. We must do
|
||||||
|
* this before we can use LWLocks. In the !EXEC_BACKEND case (here)
|
||||||
|
* this could be delayed a bit further, but EXEC_BACKEND needs to do
|
||||||
|
* stuff with LWLocks before PostgresMain(), so we do it here as well
|
||||||
|
* for symmetry.
|
||||||
|
*/
|
||||||
|
InitProcess();
|
||||||
|
|
||||||
/* And run the backend */
|
/* And run the backend */
|
||||||
BackendRun(port);
|
BackendRun(port);
|
||||||
}
|
}
|
||||||
|
@ -4058,20 +4058,13 @@ PostgresMain(int argc, char *argv[],
|
|||||||
* point during startup that postmaster does so.
|
* point during startup that postmaster does so.
|
||||||
*/
|
*/
|
||||||
PgStartTime = GetCurrentTimestamp();
|
PgStartTime = GetCurrentTimestamp();
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create a per-backend PGPROC struct in shared memory, except in the
|
* Create a per-backend PGPROC struct in shared memory. We must do
|
||||||
* EXEC_BACKEND case where this was done in SubPostmasterMain. We must do
|
* this before we can use LWLocks.
|
||||||
* this before we can use LWLocks (and in the EXEC_BACKEND case we already
|
|
||||||
* had to do some stuff with LWLocks).
|
|
||||||
*/
|
*/
|
||||||
#ifdef EXEC_BACKEND
|
|
||||||
if (!IsUnderPostmaster)
|
|
||||||
InitProcess();
|
InitProcess();
|
||||||
#else
|
}
|
||||||
InitProcess();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Early initialization */
|
/* Early initialization */
|
||||||
BaseInit();
|
BaseInit();
|
||||||
|
Loading…
Reference in New Issue
Block a user