aboutsummaryrefslogtreecommitdiff
path: root/src/backend/bootstrap
diff options
context:
space:
mode:
authorJan Wieck <JanWieck@Yahoo.com>2003-11-19 15:55:08 +0000
committerJan Wieck <JanWieck@Yahoo.com>2003-11-19 15:55:08 +0000
commitcfeca62148582a05466362f1957572f5a9900ab5 (patch)
tree6a2c5086a40d410ceb8555d8f94b7f5492979283 /src/backend/bootstrap
parent5032f83082e5bdb37f8dbf02fa00c4886fb6d2ce (diff)
downloadpostgresql-cfeca62148582a05466362f1957572f5a9900ab5.tar.gz
postgresql-cfeca62148582a05466362f1957572f5a9900ab5.zip
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
Diffstat (limited to 'src/backend/bootstrap')
-rw-r--r--src/backend/bootstrap/bootstrap.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c
index cfd8a553582..bb67feab71f 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.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();