1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-26 01:22:12 +03:00

Make it easy to detach completely from shared memory.

The new function dsm_detach_all() can be used either by postmaster
children that don't wish to take any risk of accidentally corrupting
shared memory; or by forked children of regular backends with
the same need.  This patch also updates the postmaster children that
already do PGSharedMemoryDetach() to do dsm_detach_all() as well.

Per discussion with Tom Lane.
This commit is contained in:
Robert Haas
2014-03-18 07:58:53 -04:00
parent 551fb5ac74
commit 79a4d24f31
5 changed files with 34 additions and 0 deletions

View File

@ -40,6 +40,7 @@
#include "postmaster/fork_process.h"
#include "postmaster/pgarch.h"
#include "postmaster/postmaster.h"
#include "storage/dsm.h"
#include "storage/fd.h"
#include "storage/ipc.h"
#include "storage/latch.h"
@ -163,6 +164,7 @@ pgarch_start(void)
on_exit_reset();
/* Drop our connection to postmaster's shared memory, as well */
dsm_detach_all();
PGSharedMemoryDetach();
PgArchiverMain(0, NULL);