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

Fix for hang after postmaster restart. Add new proc_exit and

shmem_exit to replace exitpg().
This commit is contained in:
Bruce Momjian
1998-06-27 04:53:49 +00:00
parent 8fa93b016a
commit e747c58718
18 changed files with 130 additions and 123 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.29 1998/06/15 19:29:41 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.30 1998/06/27 04:53:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -142,7 +142,7 @@ elog(int lev, const char *fmt,...)
write(open("/dev/console", O_WRONLY, 0666), line, len);
fflush(stdout);
fflush(stderr);
exitpg(lev);
proc_exit(lev);
}
fsync(Err_file);
}
@@ -201,14 +201,14 @@ elog(int lev, const char *fmt,...)
fflush(stderr);
ProcReleaseSpins(NULL); /* get rid of spinlocks we hold */
ProcReleaseLocks(); /* get rid of real locks we hold */
exitpg(0);
proc_exit(0);
}
if (lev > FATAL)
{
fflush(stdout);
fflush(stderr);
exitpg(lev);
proc_exit(lev);
}
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/exc.c,v 1.20 1998/02/26 04:37:35 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/exc.c,v 1.21 1998/06/27 04:53:45 momjian Exp $
*
* NOTE
* XXX this code needs improvement--check for state violations and
@@ -78,7 +78,7 @@ EnableExceptionHandling(bool on)
if (on == ExceptionHandlingEnabled)
{
/* XXX add logging of failed state */
exitpg(255);
proc_exit(255);
/* ExitPostgres(FatalExitStatus); */
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.15 1998/05/29 17:00:19 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.16 1998/06/27 04:53:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -84,7 +84,7 @@ unsigned char RecodeBackTable[128];
void
ExitPostgres(ExitStatus status)
{
exitpg(status);
proc_exit(status);
}
/*
@@ -111,7 +111,7 @@ AbortPostgres()
if (PointerIsValid(abortValue) && abortValue[0] != '\0')
abort();
else
exitpg(FatalExitStatus);
proc_exit(FatalExitStatus);
}
#endif
@@ -125,7 +125,7 @@ StatusBackendExit(int status)
{
/* someday, do some real cleanup and then call the LISP exit */
/* someday, call StatusPostmasterExit if running without postmaster */
exitpg(status);
proc_exit(status);
}
/* ----------------
@@ -136,7 +136,7 @@ void
StatusPostmasterExit(int status)
{
/* someday, do some real cleanup and then call the LISP exit */
exitpg(status);
proc_exit(status);
}
/* ----------------------------------------------------------------

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.29 1998/06/15 19:29:49 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.30 1998/06/27 04:53:48 momjian Exp $
*
* NOTES
* InitPostgres() is the function called from PostgresMain
@@ -481,7 +481,7 @@ InitPostgres(char *name) /* database name */
InitLocalBuffer();
if (!TransactionFlushEnabled())
on_exitpg(FlushBufferPool, (caddr_t) NULL);
on_shmem_exit(FlushBufferPool, (caddr_t) NULL);
/* ----------------
* initialize the database id used for system caches and lock tables
@@ -601,7 +601,7 @@ InitPostgres(char *name) /* database name */
* ----------------
*/
PostgresIsInitialized = true;
/* on_exitpg(DestroyLocalRelList, (caddr_t) NULL); */
/* on_shmem_exit(DestroyLocalRelList, (caddr_t) NULL); */
/* ----------------
* Done with "InitPostgres", now change to NormalProcessing unless