From 4b6c198a6af427fd3531b09cd6fa15e715de6aa5 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 6 Mar 2003 00:04:27 +0000 Subject: Add code to dump contents of free space map into $PGDATA/global/pg_fsm.cache at database shutdown, and then load it again at database startup. This preserves our hard-won knowledge of free space across restarts (given an orderly shutdown, that is). --- src/backend/bootstrap/bootstrap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/backend/bootstrap/bootstrap.c') diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index cf0c1de7c62..f120192bc88 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.147 2002/12/15 16:17:38 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.148 2003/03/06 00:04:27 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -34,6 +34,7 @@ #include "executor/executor.h" #include "libpq/pqsignal.h" #include "miscadmin.h" +#include "storage/freespace.h" #include "storage/ipc.h" #include "storage/proc.h" #include "tcop/tcopprot.h" @@ -398,10 +399,12 @@ BootstrapMain(int argc, char *argv[]) case BS_XLOG_STARTUP: StartupXLOG(); + LoadFreeSpaceMap(); proc_exit(0); /* done */ case BS_XLOG_SHUTDOWN: ShutdownXLOG(); + DumpFreeSpaceMap(); proc_exit(0); /* done */ default: -- cgit v1.2.3