@@ -442,7 +442,7 @@ static int CountChildren(int target);
442442static bool assign_backendlist_entry (RegisteredBgWorker * rw );
443443static void maybe_start_bgworkers (void );
444444static bool CreateOptsFile (int argc , char * argv [], char * fullprogname );
445- static pid_t StartChildProcess (AuxProcType type );
445+ static pid_t StartChildProcess (BackendType type );
446446static void StartAutovacuumWorker (void );
447447static void MaybeStartWalReceiver (void );
448448static void MaybeStartWalSummarizer (void );
@@ -1452,14 +1452,14 @@ PostmasterMain(int argc, char *argv[])
14521452
14531453 /* Start bgwriter and checkpointer so they can help with recovery */
14541454 if (CheckpointerPID == 0 )
1455- CheckpointerPID = StartChildProcess (CheckpointerProcess );
1455+ CheckpointerPID = StartChildProcess (B_CHECKPOINTER );
14561456 if (BgWriterPID == 0 )
1457- BgWriterPID = StartChildProcess (BgWriterProcess );
1457+ BgWriterPID = StartChildProcess (B_BG_WRITER );
14581458
14591459 /*
14601460 * We're ready to rock and roll...
14611461 */
1462- StartupPID = StartChildProcess (StartupProcess );
1462+ StartupPID = StartChildProcess (B_STARTUP );
14631463 Assert (StartupPID != 0 );
14641464 StartupStatus = STARTUP_RUNNING ;
14651465 pmState = PM_STARTUP ;
@@ -1793,9 +1793,9 @@ ServerLoop(void)
17931793 pmState == PM_HOT_STANDBY || pmState == PM_STARTUP )
17941794 {
17951795 if (CheckpointerPID == 0 )
1796- CheckpointerPID = StartChildProcess (CheckpointerProcess );
1796+ CheckpointerPID = StartChildProcess (B_CHECKPOINTER );
17971797 if (BgWriterPID == 0 )
1798- BgWriterPID = StartChildProcess (BgWriterProcess );
1798+ BgWriterPID = StartChildProcess (B_BG_WRITER );
17991799 }
18001800
18011801 /*
@@ -1804,7 +1804,7 @@ ServerLoop(void)
18041804 * be writing any new WAL).
18051805 */
18061806 if (WalWriterPID == 0 && pmState == PM_RUN )
1807- WalWriterPID = StartChildProcess (WalWriterProcess );
1807+ WalWriterPID = StartChildProcess (B_WAL_WRITER );
18081808
18091809 /*
18101810 * If we have lost the autovacuum launcher, try to start a new one. We
@@ -1823,7 +1823,7 @@ ServerLoop(void)
18231823
18241824 /* If we have lost the archiver, try to start a new one. */
18251825 if (PgArchPID == 0 && PgArchStartupAllowed ())
1826- PgArchPID = StartChildProcess (ArchiverProcess );
1826+ PgArchPID = StartChildProcess (B_ARCHIVER );
18271827
18281828 /* If we need to start a slot sync worker, try to do that now */
18291829 MaybeStartSlotSyncWorker ();
@@ -3003,11 +3003,11 @@ process_pm_child_exit(void)
30033003 * if this fails, we'll just try again later.
30043004 */
30053005 if (CheckpointerPID == 0 )
3006- CheckpointerPID = StartChildProcess (CheckpointerProcess );
3006+ CheckpointerPID = StartChildProcess (B_CHECKPOINTER );
30073007 if (BgWriterPID == 0 )
3008- BgWriterPID = StartChildProcess (BgWriterProcess );
3008+ BgWriterPID = StartChildProcess (B_BG_WRITER );
30093009 if (WalWriterPID == 0 )
3010- WalWriterPID = StartChildProcess (WalWriterProcess );
3010+ WalWriterPID = StartChildProcess (B_WAL_WRITER );
30113011 MaybeStartWalSummarizer ();
30123012
30133013 /*
@@ -3017,7 +3017,7 @@ process_pm_child_exit(void)
30173017 if (!IsBinaryUpgrade && AutoVacuumingActive () && AutoVacPID == 0 )
30183018 AutoVacPID = StartAutoVacLauncher ();
30193019 if (PgArchStartupAllowed () && PgArchPID == 0 )
3020- PgArchPID = StartChildProcess (ArchiverProcess );
3020+ PgArchPID = StartChildProcess (B_ARCHIVER );
30213021 MaybeStartSlotSyncWorker ();
30223022
30233023 /* workers may be scheduled to start now */
@@ -3173,7 +3173,7 @@ process_pm_child_exit(void)
31733173 HandleChildCrash (pid , exitstatus ,
31743174 _ ("archiver process" ));
31753175 if (PgArchStartupAllowed ())
3176- PgArchPID = StartChildProcess (ArchiverProcess );
3176+ PgArchPID = StartChildProcess (B_ARCHIVER );
31773177 continue ;
31783178 }
31793179
@@ -3777,7 +3777,7 @@ PostmasterStateMachine(void)
37773777 Assert (Shutdown > NoShutdown );
37783778 /* Start the checkpointer if not running */
37793779 if (CheckpointerPID == 0 )
3780- CheckpointerPID = StartChildProcess (CheckpointerProcess );
3780+ CheckpointerPID = StartChildProcess (B_CHECKPOINTER );
37813781 /* And tell it to shut down */
37823782 if (CheckpointerPID != 0 )
37833783 {
@@ -3932,7 +3932,7 @@ PostmasterStateMachine(void)
39323932 /* re-create shared memory and semaphores */
39333933 CreateSharedMemoryAndSemaphores ();
39343934
3935- StartupPID = StartChildProcess (StartupProcess );
3935+ StartupPID = StartChildProcess (B_STARTUP );
39363936 Assert (StartupPID != 0 );
39373937 StartupStatus = STARTUP_RUNNING ;
39383938 pmState = PM_STARTUP ;
@@ -4967,7 +4967,7 @@ SubPostmasterMain(int argc, char *argv[])
49674967 }
49684968 if (strcmp (argv [1 ], "--forkaux" ) == 0 )
49694969 {
4970- AuxProcType auxtype ;
4970+ BackendType auxtype ;
49714971
49724972 Assert (argc == 4 );
49734973
@@ -5087,7 +5087,7 @@ process_pm_pmsignal(void)
50875087 */
50885088 Assert (PgArchPID == 0 );
50895089 if (XLogArchivingAlways ())
5090- PgArchPID = StartChildProcess (ArchiverProcess );
5090+ PgArchPID = StartChildProcess (B_ARCHIVER );
50915091
50925092 /*
50935093 * If we aren't planning to enter hot standby mode later, treat
@@ -5313,7 +5313,7 @@ CountChildren(int target)
53135313 * to start subprocess.
53145314 */
53155315static pid_t
5316- StartChildProcess (AuxProcType type )
5316+ StartChildProcess (BackendType type )
53175317{
53185318 pid_t pid ;
53195319
@@ -5365,31 +5365,31 @@ StartChildProcess(AuxProcType type)
53655365 errno = save_errno ;
53665366 switch (type )
53675367 {
5368- case StartupProcess :
5368+ case B_STARTUP :
53695369 ereport (LOG ,
53705370 (errmsg ("could not fork startup process: %m" )));
53715371 break ;
5372- case ArchiverProcess :
5372+ case B_ARCHIVER :
53735373 ereport (LOG ,
53745374 (errmsg ("could not fork archiver process: %m" )));
53755375 break ;
5376- case BgWriterProcess :
5376+ case B_BG_WRITER :
53775377 ereport (LOG ,
53785378 (errmsg ("could not fork background writer process: %m" )));
53795379 break ;
5380- case CheckpointerProcess :
5380+ case B_CHECKPOINTER :
53815381 ereport (LOG ,
53825382 (errmsg ("could not fork checkpointer process: %m" )));
53835383 break ;
5384- case WalWriterProcess :
5384+ case B_WAL_WRITER :
53855385 ereport (LOG ,
53865386 (errmsg ("could not fork WAL writer process: %m" )));
53875387 break ;
5388- case WalReceiverProcess :
5388+ case B_WAL_RECEIVER :
53895389 ereport (LOG ,
53905390 (errmsg ("could not fork WAL receiver process: %m" )));
53915391 break ;
5392- case WalSummarizerProcess :
5392+ case B_WAL_SUMMARIZER :
53935393 ereport (LOG ,
53945394 (errmsg ("could not fork WAL summarizer process: %m" )));
53955395 break ;
@@ -5403,7 +5403,7 @@ StartChildProcess(AuxProcType type)
54035403 * fork failure is fatal during startup, but there's no need to choke
54045404 * immediately if starting other child types fails.
54055405 */
5406- if (type == StartupProcess )
5406+ if (type == B_STARTUP )
54075407 ExitPostmaster (1 );
54085408 return 0 ;
54095409 }
@@ -5522,7 +5522,7 @@ MaybeStartWalReceiver(void)
55225522 pmState == PM_HOT_STANDBY ) &&
55235523 Shutdown <= SmartShutdown )
55245524 {
5525- WalReceiverPID = StartChildProcess (WalReceiverProcess );
5525+ WalReceiverPID = StartChildProcess (B_WAL_RECEIVER );
55265526 if (WalReceiverPID != 0 )
55275527 WalReceiverRequested = false;
55285528 /* else leave the flag set, so we'll try again later */
@@ -5539,7 +5539,7 @@ MaybeStartWalSummarizer(void)
55395539 if (summarize_wal && WalSummarizerPID == 0 &&
55405540 (pmState == PM_RUN || pmState == PM_HOT_STANDBY ) &&
55415541 Shutdown <= SmartShutdown )
5542- WalSummarizerPID = StartChildProcess (WalSummarizerProcess );
5542+ WalSummarizerPID = StartChildProcess (B_WAL_SUMMARIZER );
55435543}
55445544
55455545
0 commit comments