aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/heap/heapam.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2008-11-19 10:34:52 +0000
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2008-11-19 10:34:52 +0000
commit3396000684b41e7e9467d1abc67152b39e697035 (patch)
treec8edf238f89cd7b0b1562b919f2addebc67eb54e /src/backend/access/heap/heapam.c
parent26e6c896c946bc1a9e9f608b2c7463be1e8c6291 (diff)
downloadpostgresql-3396000684b41e7e9467d1abc67152b39e697035.tar.gz
postgresql-3396000684b41e7e9467d1abc67152b39e697035.zip
Rethink the way FSM truncation works. Instead of WAL-logging FSM
truncations in FSM code, call FreeSpaceMapTruncateRel from smgr_redo. To make that cleaner from modularity point of view, move the WAL-logging one level up to RelationTruncate, and move RelationTruncate and all the related WAL-logging to new src/backend/catalog/storage.c file. Introduce new RelationCreateStorage and RelationDropStorage functions that are used instead of calling smgrcreate/smgrscheduleunlink directly. Move the pending rel deletion stuff from smgrcreate/smgrscheduleunlink to the new functions. This leaves smgr.c as a thin wrapper around md.c; all the transactional stuff is now in storage.c. This will make it easier to add new forks with similar truncation logic, like the visibility map.
Diffstat (limited to 'src/backend/access/heap/heapam.c')
-rw-r--r--src/backend/access/heap/heapam.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 7139b03471e..f6d75c6e2b2 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.269 2008/11/06 20:51:14 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.270 2008/11/19 10:34:50 heikki Exp $
*
*
* INTERFACE ROUTINES
@@ -4863,8 +4863,7 @@ heap_sync(Relation rel)
/* FlushRelationBuffers will have opened rd_smgr */
smgrimmedsync(rel->rd_smgr, MAIN_FORKNUM);
- /* sync FSM as well */
- smgrimmedsync(rel->rd_smgr, FSM_FORKNUM);
+ /* FSM is not critical, don't bother syncing it */
/* toast heap, if any */
if (OidIsValid(rel->rd_rel->reltoastrelid))
@@ -4874,7 +4873,6 @@ heap_sync(Relation rel)
toastrel = heap_open(rel->rd_rel->reltoastrelid, AccessShareLock);
FlushRelationBuffers(toastrel);
smgrimmedsync(toastrel->rd_smgr, MAIN_FORKNUM);
- smgrimmedsync(toastrel->rd_smgr, FSM_FORKNUM);
heap_close(toastrel, AccessShareLock);
}
}