Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5e692dc

Browse files
committed
Remove postmaster.c's reset_shared() wrapper function.
reset_shared just invokes CreateSharedMemoryAndSemaphores, so let'sget rid of it and invoke that directly. This removes a confusingseeming-inconsistency between the postmaster's startup sequenceand the startup sequence used in standalone mode.Nathan Bossart, reviewed by Pavel BorisovDiscussion:https://postgr.es/m/20220329221702.GA559657@nathanxps13
1 parent506428d commit5e692dc

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@ static void getInstallationPaths(const char *argv0);
391391
staticvoidcheckControlFile(void);
392392
staticPort*ConnCreate(intserverFd);
393393
staticvoidConnFree(Port*port);
394-
staticvoidreset_shared(void);
395394
staticvoidSIGHUP_handler(SIGNAL_ARGS);
396395
staticvoidpmdie(SIGNAL_ARGS);
397396
staticvoidreaper(SIGNAL_ARGS);
@@ -1081,8 +1080,12 @@ PostmasterMain(int argc, char *argv[])
10811080

10821081
/*
10831082
* Set up shared memory and semaphores.
1083+
*
1084+
* Note: if using SysV shmem and/or semas, each postmaster startup will
1085+
* normally choose the same IPC keys. This helps ensure that we will
1086+
* clean up dead IPC objects if the postmaster crashes and is restarted.
10841087
*/
1085-
reset_shared();
1088+
CreateSharedMemoryAndSemaphores();
10861089

10871090
/*
10881091
* Estimate number of openable files. This must happen after setting up
@@ -2723,23 +2726,6 @@ InitProcessGlobals(void)
27232726
}
27242727

27252728

2726-
/*
2727-
* reset_shared -- reset shared memory and semaphores
2728-
*/
2729-
staticvoid
2730-
reset_shared(void)
2731-
{
2732-
/*
2733-
* Create or re-create shared memory and semaphores.
2734-
*
2735-
* Note: in each "cycle of life" we will normally assign the same IPC keys
2736-
* (if using SysV shmem and/or semas). This helps ensure that we will
2737-
* clean up dead IPC objects if the postmaster crashes and is restarted.
2738-
*/
2739-
CreateSharedMemoryAndSemaphores();
2740-
}
2741-
2742-
27432729
/*
27442730
* SIGHUP -- reread config files, and tell children to do same
27452731
*/
@@ -4022,7 +4008,8 @@ PostmasterStateMachine(void)
40224008
/* re-read control file into local memory */
40234009
LocalProcessControlFile(true);
40244010

4025-
reset_shared();
4011+
/* re-create shared memory and semaphores */
4012+
CreateSharedMemoryAndSemaphores();
40264013

40274014
StartupPID=StartupDataBase();
40284015
Assert(StartupPID!=0);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp