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
|
* Extend the database directory structure before continuing with
|
||||||
* initialization - one of the later steps might require them to exist.
|
* initialization - one of the later steps might require them to exist.
|
||||||
|
* If in a sub-process (windows / EXEC_BACKEND) this already has been
|
||||||
|
* done.
|
||||||
*/
|
*/
|
||||||
|
if (!IsUnderPostmaster)
|
||||||
|
{
|
||||||
CreateRequiredDirectories();
|
CreateRequiredDirectories();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Register Citus configuration variables. Do so before intercepting
|
* Register Citus configuration variables. Do so before intercepting
|
||||||
|
|
|
@ -297,7 +297,10 @@ void
|
||||||
InitializeBackendManagement(void)
|
InitializeBackendManagement(void)
|
||||||
{
|
{
|
||||||
/* allocate shared memory */
|
/* allocate shared memory */
|
||||||
|
if (!IsUnderPostmaster)
|
||||||
|
{
|
||||||
RequestAddinShmemSpace(BackendManagementShmemSize());
|
RequestAddinShmemSpace(BackendManagementShmemSize());
|
||||||
|
}
|
||||||
|
|
||||||
prev_shmem_startup_hook = shmem_startup_hook;
|
prev_shmem_startup_hook = shmem_startup_hook;
|
||||||
shmem_startup_hook = BackendManagementShmemInit;
|
shmem_startup_hook = BackendManagementShmemInit;
|
||||||
|
|
|
@ -106,8 +106,11 @@ static bool LockCitusExtension(void);
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
InitializeMaintenanceDaemon(void)
|
InitializeMaintenanceDaemon(void)
|
||||||
|
{
|
||||||
|
if (!IsUnderPostmaster)
|
||||||
{
|
{
|
||||||
RequestAddinShmemSpace(MaintenanceDaemonShmemSize());
|
RequestAddinShmemSpace(MaintenanceDaemonShmemSize());
|
||||||
|
}
|
||||||
|
|
||||||
prev_shmem_startup_hook = shmem_startup_hook;
|
prev_shmem_startup_hook = shmem_startup_hook;
|
||||||
shmem_startup_hook = MaintenanceDaemonShmemInit;
|
shmem_startup_hook = MaintenanceDaemonShmemInit;
|
||||||
|
|
|
@ -100,12 +100,17 @@ TaskTrackerRegister(void)
|
||||||
{
|
{
|
||||||
BackgroundWorker worker;
|
BackgroundWorker worker;
|
||||||
|
|
||||||
/* organize and register initialization of required shared memory */
|
|
||||||
RequestAddinShmemSpace(TaskTrackerShmemSize());
|
|
||||||
|
|
||||||
prev_shmem_startup_hook = shmem_startup_hook;
|
prev_shmem_startup_hook = shmem_startup_hook;
|
||||||
shmem_startup_hook = TaskTrackerShmemInit;
|
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 */
|
/* and that the task tracker is started as background worker */
|
||||||
memset(&worker, 0, sizeof(worker));
|
memset(&worker, 0, sizeof(worker));
|
||||||
worker.bgw_flags = BGWORKER_SHMEM_ACCESS;
|
worker.bgw_flags = BGWORKER_SHMEM_ACCESS;
|
||||||
|
|
Loading…
Reference in New Issue