mirror of https://github.com/citusdata/citus.git
Protect some initializations from being called during backend startup.
On EXEC_BACKEND builds these functions shouldn't be called at every backend start.pull/1816/head
parent
d267e0f9fa
commit
d063658d6d
|
@ -170,8 +170,13 @@ _PG_init(void)
|
|||
/*
|
||||
* Extend the database directory structure before continuing with
|
||||
* initialization - one of the later steps might require them to exist.
|
||||
* If in a sub-process (windows / EXEC_BACKEND) this already has been
|
||||
* done.
|
||||
*/
|
||||
CreateRequiredDirectories();
|
||||
if (!IsUnderPostmaster)
|
||||
{
|
||||
CreateRequiredDirectories();
|
||||
}
|
||||
|
||||
/*
|
||||
* Register Citus configuration variables. Do so before intercepting
|
||||
|
|
|
@ -297,7 +297,10 @@ void
|
|||
InitializeBackendManagement(void)
|
||||
{
|
||||
/* allocate shared memory */
|
||||
RequestAddinShmemSpace(BackendManagementShmemSize());
|
||||
if (!IsUnderPostmaster)
|
||||
{
|
||||
RequestAddinShmemSpace(BackendManagementShmemSize());
|
||||
}
|
||||
|
||||
prev_shmem_startup_hook = shmem_startup_hook;
|
||||
shmem_startup_hook = BackendManagementShmemInit;
|
||||
|
|
|
@ -107,7 +107,10 @@ static bool LockCitusExtension(void);
|
|||
void
|
||||
InitializeMaintenanceDaemon(void)
|
||||
{
|
||||
RequestAddinShmemSpace(MaintenanceDaemonShmemSize());
|
||||
if (!IsUnderPostmaster)
|
||||
{
|
||||
RequestAddinShmemSpace(MaintenanceDaemonShmemSize());
|
||||
}
|
||||
|
||||
prev_shmem_startup_hook = shmem_startup_hook;
|
||||
shmem_startup_hook = MaintenanceDaemonShmemInit;
|
||||
|
|
|
@ -100,12 +100,17 @@ TaskTrackerRegister(void)
|
|||
{
|
||||
BackgroundWorker worker;
|
||||
|
||||
/* organize and register initialization of required shared memory */
|
||||
RequestAddinShmemSpace(TaskTrackerShmemSize());
|
||||
|
||||
prev_shmem_startup_hook = shmem_startup_hook;
|
||||
shmem_startup_hook = TaskTrackerShmemInit;
|
||||
|
||||
if (IsUnderPostmaster)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* organize and register initialization of required shared memory */
|
||||
RequestAddinShmemSpace(TaskTrackerShmemSize());
|
||||
|
||||
/* and that the task tracker is started as background worker */
|
||||
memset(&worker, 0, sizeof(worker));
|
||||
worker.bgw_flags = BGWORKER_SHMEM_ACCESS;
|
||||
|
|
Loading…
Reference in New Issue