From 8a6fab412e35d8495201a13d8258f26b730306f5 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 25 Sep 2002 20:31:40 +0000 Subject: Remove ShutdownBufferPoolAccess exit callback, and do the work in ProcKill instead, where we still have a PGPROC with which to wait on LWLocks. This fixes 'can't wait without a PROC structure' failures occasionally seen during backend shutdown (I'm surprised they weren't more frequent, actually). Add an Assert() to LWLockAcquire to help catch any similar mistakes in future. Fix failure to update MyProcPid for standalone backends and pgstat processes. --- src/backend/bootstrap/bootstrap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/backend/bootstrap/bootstrap.c') diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index b22631700b4..4df563b4285 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -8,7 +8,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.142 2002/09/22 19:42:50 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.143 2002/09/25 20:31:40 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -369,6 +369,9 @@ BootstrapMain(int argc, char *argv[]) BaseInit(); + if (IsUnderPostmaster) + InitDummyProcess(); /* needed to get LWLocks */ + /* * XLOG operations */ @@ -386,8 +389,6 @@ BootstrapMain(int argc, char *argv[]) break; case BS_XLOG_CHECKPOINT: - if (IsUnderPostmaster) - InitDummyProcess(); /* needed to get LWLocks */ CreateDummyCaches(); CreateCheckPoint(false); SetSavedRedoRecPtr(); /* pass redo ptr back to -- cgit v1.2.3