diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-03-06 00:04:27 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-03-06 00:04:27 +0000 |
commit | 4b6c198a6af427fd3531b09cd6fa15e715de6aa5 (patch) | |
tree | 5eed566a56b5daff030ae202427cce369227ee4f /src/backend/tcop/postgres.c | |
parent | 21591967bc19c749a100fb97ec82f6086ce5cc3c (diff) | |
download | postgresql-4b6c198a6af427fd3531b09cd6fa15e715de6aa5.tar.gz postgresql-4b6c198a6af427fd3531b09cd6fa15e715de6aa5.zip |
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).
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r-- | src/backend/tcop/postgres.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index d6366a1104d..b4f064d0e1b 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.315 2003/02/10 04:44:46 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.316 2003/03/06 00:04:27 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -46,6 +46,7 @@ #include "parser/analyze.h" #include "parser/parser.h" #include "rewrite/rewriteHandler.h" +#include "storage/freespace.h" #include "storage/ipc.h" #include "storage/proc.h" #include "tcop/fastpath.h" @@ -1740,6 +1741,13 @@ PostgresMain(int argc, char *argv[], const char *username) */ StartupXLOG(); on_shmem_exit(ShutdownXLOG, 0); + + /* + * Read any existing FSM cache file, and register to write one out + * at exit. + */ + LoadFreeSpaceMap(); + on_shmem_exit(DumpFreeSpaceMap, 0); } /* @@ -1781,7 +1789,7 @@ PostgresMain(int argc, char *argv[], const char *username) if (!IsUnderPostmaster) { puts("\nPOSTGRES backend interactive interface "); - puts("$Revision: 1.315 $ $Date: 2003/02/10 04:44:46 $\n"); + puts("$Revision: 1.316 $ $Date: 2003/03/06 00:04:27 $\n"); } /* |