1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +03:00

Cause stats processes to detach from shared memory when started, so that

they do not prevent the postmaster from deleting the shmem segment during
a post-backend-crash restart cycle.  Per recent discussion.
This commit is contained in:
Tom Lane
2003-11-07 21:55:50 +00:00
parent 7e4a629492
commit f8a769b47a
3 changed files with 35 additions and 11 deletions

View File

@@ -13,7 +13,7 @@
*
* Copyright (c) 2001-2003, PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.45 2003/09/25 06:58:01 petere Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.46 2003/11/07 21:55:50 tgl Exp $
* ----------
*/
#include "postgres.h"
@@ -44,6 +44,7 @@
#include "utils/memutils.h"
#include "storage/backendid.h"
#include "storage/ipc.h"
#include "storage/pg_shmem.h"
#include "utils/rel.h"
#include "utils/hsearch.h"
#include "utils/ps_status.h"
@@ -400,6 +401,9 @@ pgstat_start(void)
/* Close the postmaster's sockets, except for pgstat link */
ClosePostmasterPorts(false);
/* Drop our connection to postmaster's shared memory, as well */
PGSharedMemoryDetach();
pgstat_main();
exit(0);