mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
Background writer process
This first part of the background writer does no syncing at all. It's only purpose is to keep the LRU heads clean so that regular backends seldom to never have to call write(). Jan
This commit is contained in:
@ -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.166 2003/09/02 19:04:12 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.167 2003/11/19 15:55:07 wieck Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -428,8 +428,20 @@ BootstrapMain(int argc, char *argv[])
|
||||
|
||||
BaseInit();
|
||||
|
||||
/* needed to get LWLocks */
|
||||
if (IsUnderPostmaster)
|
||||
InitDummyProcess(); /* needed to get LWLocks */
|
||||
{
|
||||
switch (xlogop)
|
||||
{
|
||||
case BS_XLOG_BGWRITER:
|
||||
InitDummyProcess(DUMMY_PROC_BGWRITER);
|
||||
break;
|
||||
|
||||
default:
|
||||
InitDummyProcess(DUMMY_PROC_DEFAULT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* XLOG operations
|
||||
@ -453,6 +465,11 @@ BootstrapMain(int argc, char *argv[])
|
||||
* postmaster */
|
||||
proc_exit(0); /* done */
|
||||
|
||||
case BS_XLOG_BGWRITER:
|
||||
CreateDummyCaches();
|
||||
BufferBackgroundWriter();
|
||||
proc_exit(0); /* done */
|
||||
|
||||
case BS_XLOG_STARTUP:
|
||||
StartupXLOG();
|
||||
LoadFreeSpaceMap();
|
||||
|
Reference in New Issue
Block a user