@@ -442,7 +442,7 @@ static int CountChildren(int target);
442
442
static bool assign_backendlist_entry (RegisteredBgWorker * rw );
443
443
static void maybe_start_bgworkers (void );
444
444
static bool CreateOptsFile (int argc , char * argv [], char * fullprogname );
445
- static pid_t StartChildProcess (AuxProcType type );
445
+ static pid_t StartChildProcess (BackendType type );
446
446
static void StartAutovacuumWorker (void );
447
447
static void MaybeStartWalReceiver (void );
448
448
static void MaybeStartWalSummarizer (void );
@@ -1452,14 +1452,14 @@ PostmasterMain(int argc, char *argv[])
1452
1452
1453
1453
/* Start bgwriter and checkpointer so they can help with recovery */
1454
1454
if (CheckpointerPID == 0 )
1455
- CheckpointerPID = StartChildProcess (CheckpointerProcess );
1455
+ CheckpointerPID = StartChildProcess (B_CHECKPOINTER );
1456
1456
if (BgWriterPID == 0 )
1457
- BgWriterPID = StartChildProcess (BgWriterProcess );
1457
+ BgWriterPID = StartChildProcess (B_BG_WRITER );
1458
1458
1459
1459
/*
1460
1460
* We're ready to rock and roll...
1461
1461
*/
1462
- StartupPID = StartChildProcess (StartupProcess );
1462
+ StartupPID = StartChildProcess (B_STARTUP );
1463
1463
Assert (StartupPID != 0 );
1464
1464
StartupStatus = STARTUP_RUNNING ;
1465
1465
pmState = PM_STARTUP ;
@@ -1793,9 +1793,9 @@ ServerLoop(void)
1793
1793
pmState == PM_HOT_STANDBY || pmState == PM_STARTUP )
1794
1794
{
1795
1795
if (CheckpointerPID == 0 )
1796
- CheckpointerPID = StartChildProcess (CheckpointerProcess );
1796
+ CheckpointerPID = StartChildProcess (B_CHECKPOINTER );
1797
1797
if (BgWriterPID == 0 )
1798
- BgWriterPID = StartChildProcess (BgWriterProcess );
1798
+ BgWriterPID = StartChildProcess (B_BG_WRITER );
1799
1799
}
1800
1800
1801
1801
/*
@@ -1804,7 +1804,7 @@ ServerLoop(void)
1804
1804
* be writing any new WAL).
1805
1805
*/
1806
1806
if (WalWriterPID == 0 && pmState == PM_RUN )
1807
- WalWriterPID = StartChildProcess (WalWriterProcess );
1807
+ WalWriterPID = StartChildProcess (B_WAL_WRITER );
1808
1808
1809
1809
/*
1810
1810
* If we have lost the autovacuum launcher, try to start a new one. We
@@ -1823,7 +1823,7 @@ ServerLoop(void)
1823
1823
1824
1824
/* If we have lost the archiver, try to start a new one. */
1825
1825
if (PgArchPID == 0 && PgArchStartupAllowed ())
1826
- PgArchPID = StartChildProcess (ArchiverProcess );
1826
+ PgArchPID = StartChildProcess (B_ARCHIVER );
1827
1827
1828
1828
/* If we need to start a slot sync worker, try to do that now */
1829
1829
MaybeStartSlotSyncWorker ();
@@ -3003,11 +3003,11 @@ process_pm_child_exit(void)
3003
3003
* if this fails, we'll just try again later.
3004
3004
*/
3005
3005
if (CheckpointerPID == 0 )
3006
- CheckpointerPID = StartChildProcess (CheckpointerProcess );
3006
+ CheckpointerPID = StartChildProcess (B_CHECKPOINTER );
3007
3007
if (BgWriterPID == 0 )
3008
- BgWriterPID = StartChildProcess (BgWriterProcess );
3008
+ BgWriterPID = StartChildProcess (B_BG_WRITER );
3009
3009
if (WalWriterPID == 0 )
3010
- WalWriterPID = StartChildProcess (WalWriterProcess );
3010
+ WalWriterPID = StartChildProcess (B_WAL_WRITER );
3011
3011
MaybeStartWalSummarizer ();
3012
3012
3013
3013
/*
@@ -3017,7 +3017,7 @@ process_pm_child_exit(void)
3017
3017
if (!IsBinaryUpgrade && AutoVacuumingActive () && AutoVacPID == 0 )
3018
3018
AutoVacPID = StartAutoVacLauncher ();
3019
3019
if (PgArchStartupAllowed () && PgArchPID == 0 )
3020
- PgArchPID = StartChildProcess (ArchiverProcess );
3020
+ PgArchPID = StartChildProcess (B_ARCHIVER );
3021
3021
MaybeStartSlotSyncWorker ();
3022
3022
3023
3023
/* workers may be scheduled to start now */
@@ -3173,7 +3173,7 @@ process_pm_child_exit(void)
3173
3173
HandleChildCrash (pid , exitstatus ,
3174
3174
_ ("archiver process" ));
3175
3175
if (PgArchStartupAllowed ())
3176
- PgArchPID = StartChildProcess (ArchiverProcess );
3176
+ PgArchPID = StartChildProcess (B_ARCHIVER );
3177
3177
continue ;
3178
3178
}
3179
3179
@@ -3777,7 +3777,7 @@ PostmasterStateMachine(void)
3777
3777
Assert (Shutdown > NoShutdown );
3778
3778
/* Start the checkpointer if not running */
3779
3779
if (CheckpointerPID == 0 )
3780
- CheckpointerPID = StartChildProcess (CheckpointerProcess );
3780
+ CheckpointerPID = StartChildProcess (B_CHECKPOINTER );
3781
3781
/* And tell it to shut down */
3782
3782
if (CheckpointerPID != 0 )
3783
3783
{
@@ -3932,7 +3932,7 @@ PostmasterStateMachine(void)
3932
3932
/* re-create shared memory and semaphores */
3933
3933
CreateSharedMemoryAndSemaphores ();
3934
3934
3935
- StartupPID = StartChildProcess (StartupProcess );
3935
+ StartupPID = StartChildProcess (B_STARTUP );
3936
3936
Assert (StartupPID != 0 );
3937
3937
StartupStatus = STARTUP_RUNNING ;
3938
3938
pmState = PM_STARTUP ;
@@ -4967,7 +4967,7 @@ SubPostmasterMain(int argc, char *argv[])
4967
4967
}
4968
4968
if (strcmp (argv [1 ], "--forkaux" ) == 0 )
4969
4969
{
4970
- AuxProcType auxtype ;
4970
+ BackendType auxtype ;
4971
4971
4972
4972
Assert (argc == 4 );
4973
4973
@@ -5087,7 +5087,7 @@ process_pm_pmsignal(void)
5087
5087
*/
5088
5088
Assert (PgArchPID == 0 );
5089
5089
if (XLogArchivingAlways ())
5090
- PgArchPID = StartChildProcess (ArchiverProcess );
5090
+ PgArchPID = StartChildProcess (B_ARCHIVER );
5091
5091
5092
5092
/*
5093
5093
* If we aren't planning to enter hot standby mode later, treat
@@ -5313,7 +5313,7 @@ CountChildren(int target)
5313
5313
* to start subprocess.
5314
5314
*/
5315
5315
static pid_t
5316
- StartChildProcess (AuxProcType type )
5316
+ StartChildProcess (BackendType type )
5317
5317
{
5318
5318
pid_t pid ;
5319
5319
@@ -5365,31 +5365,31 @@ StartChildProcess(AuxProcType type)
5365
5365
errno = save_errno ;
5366
5366
switch (type )
5367
5367
{
5368
- case StartupProcess :
5368
+ case B_STARTUP :
5369
5369
ereport (LOG ,
5370
5370
(errmsg ("could not fork startup process: %m" )));
5371
5371
break ;
5372
- case ArchiverProcess :
5372
+ case B_ARCHIVER :
5373
5373
ereport (LOG ,
5374
5374
(errmsg ("could not fork archiver process: %m" )));
5375
5375
break ;
5376
- case BgWriterProcess :
5376
+ case B_BG_WRITER :
5377
5377
ereport (LOG ,
5378
5378
(errmsg ("could not fork background writer process: %m" )));
5379
5379
break ;
5380
- case CheckpointerProcess :
5380
+ case B_CHECKPOINTER :
5381
5381
ereport (LOG ,
5382
5382
(errmsg ("could not fork checkpointer process: %m" )));
5383
5383
break ;
5384
- case WalWriterProcess :
5384
+ case B_WAL_WRITER :
5385
5385
ereport (LOG ,
5386
5386
(errmsg ("could not fork WAL writer process: %m" )));
5387
5387
break ;
5388
- case WalReceiverProcess :
5388
+ case B_WAL_RECEIVER :
5389
5389
ereport (LOG ,
5390
5390
(errmsg ("could not fork WAL receiver process: %m" )));
5391
5391
break ;
5392
- case WalSummarizerProcess :
5392
+ case B_WAL_SUMMARIZER :
5393
5393
ereport (LOG ,
5394
5394
(errmsg ("could not fork WAL summarizer process: %m" )));
5395
5395
break ;
@@ -5403,7 +5403,7 @@ StartChildProcess(AuxProcType type)
5403
5403
* fork failure is fatal during startup, but there's no need to choke
5404
5404
* immediately if starting other child types fails.
5405
5405
*/
5406
- if (type == StartupProcess )
5406
+ if (type == B_STARTUP )
5407
5407
ExitPostmaster (1 );
5408
5408
return 0 ;
5409
5409
}
@@ -5522,7 +5522,7 @@ MaybeStartWalReceiver(void)
5522
5522
pmState == PM_HOT_STANDBY ) &&
5523
5523
Shutdown <= SmartShutdown )
5524
5524
{
5525
- WalReceiverPID = StartChildProcess (WalReceiverProcess );
5525
+ WalReceiverPID = StartChildProcess (B_WAL_RECEIVER );
5526
5526
if (WalReceiverPID != 0 )
5527
5527
WalReceiverRequested = false;
5528
5528
/* else leave the flag set, so we'll try again later */
@@ -5539,7 +5539,7 @@ MaybeStartWalSummarizer(void)
5539
5539
if (summarize_wal && WalSummarizerPID == 0 &&
5540
5540
(pmState == PM_RUN || pmState == PM_HOT_STANDBY ) &&
5541
5541
Shutdown <= SmartShutdown )
5542
- WalSummarizerPID = StartChildProcess (WalSummarizerProcess );
5542
+ WalSummarizerPID = StartChildProcess (B_WAL_SUMMARIZER );
5543
5543
}
5544
5544
5545
5545
0 commit comments