Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4b6c198

Browse files
committed
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).
1 parent 2159196 commit 4b6c198

File tree

4 files changed

+376
-83
lines changed

4 files changed

+376
-83
lines changed

src/backend/bootstrap/bootstrap.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.147 2002/12/15 16:17:38 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.148 2003/03/06 00:04:27 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -34,6 +34,7 @@
3434
#include "executor/executor.h"
3535
#include "libpq/pqsignal.h"
3636
#include "miscadmin.h"
37+
#include "storage/freespace.h"
3738
#include "storage/ipc.h"
3839
#include "storage/proc.h"
3940
#include "tcop/tcopprot.h"
@@ -398,10 +399,12 @@ BootstrapMain(int argc, char *argv[])
398399

399400
case BS_XLOG_STARTUP:
400401
StartupXLOG();
402+
LoadFreeSpaceMap();
401403
proc_exit(0); /* done */
402404

403405
case BS_XLOG_SHUTDOWN:
404406
ShutdownXLOG();
407+
DumpFreeSpaceMap();
405408
proc_exit(0); /* done */
406409

407410
default:

0 commit comments

Comments
 (0)