summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane2007-11-15 20:36:40 +0000
committerTom Lane2007-11-15 20:36:40 +0000
commit6cc4451b5c47eac02e09c3342281da469374432d (patch)
treea97187cef1c3c2a95b7094fd46d68b0f448d7f33 /src/include
parent7a550cb95cf3a541deed15df1d5e25f36af636e5 (diff)
Prevent re-use of a deleted relation's relfilenode until after the next
checkpoint. This guards against an unlikely data-loss scenario in which we re-use the relfilenode, then crash, then replay the deletion and recreation of the file. Even then we'd be OK if all insertions into the new relation had been WAL-logged ... but that's not guaranteed given all the no-WAL-logging optimizations that have recently been added. Patch by Heikki Linnakangas, per a discussion last month.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/storage/smgr.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/include/storage/smgr.h b/src/include/storage/smgr.h
index bc071e7ef0..87b0171a1b 100644
--- a/src/include/storage/smgr.h
+++ b/src/include/storage/smgr.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/storage/smgr.h,v 1.59 2007/09/05 18:10:48 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/storage/smgr.h,v 1.60 2007/11/15 20:36:40 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -83,7 +83,9 @@ extern void AtSubAbort_smgr(void);
extern void PostPrepare_smgr(void);
extern void smgrcommit(void);
extern void smgrabort(void);
+extern void smgrpreckpt(void);
extern void smgrsync(void);
+extern void smgrpostckpt(void);
extern void smgr_redo(XLogRecPtr lsn, XLogRecord *record);
extern void smgr_desc(StringInfo buf, uint8 xl_info, char *rec);
@@ -104,7 +106,9 @@ extern void mdwrite(SMgrRelation reln, BlockNumber blocknum, char *buffer,
extern BlockNumber mdnblocks(SMgrRelation reln);
extern void mdtruncate(SMgrRelation reln, BlockNumber nblocks, bool isTemp);
extern void mdimmedsync(SMgrRelation reln);
+extern void mdpreckpt(void);
extern void mdsync(void);
+extern void mdpostckpt(void);
extern void RememberFsyncRequest(RelFileNode rnode, BlockNumber segno);
extern void ForgetRelationFsyncRequests(RelFileNode rnode);