diff options
| author | Heikki Linnakangas | 2008-11-19 10:34:52 +0000 |
|---|---|---|
| committer | Heikki Linnakangas | 2008-11-19 10:34:52 +0000 |
| commit | 3396000684b41e7e9467d1abc67152b39e697035 (patch) | |
| tree | c8edf238f89cd7b0b1562b919f2addebc67eb54e /src/include/access | |
| parent | 26e6c896c946bc1a9e9f608b2c7463be1e8c6291 (diff) | |
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/include/access')
| -rw-r--r-- | src/include/access/rmgr.h | 3 | ||||
| -rw-r--r-- | src/include/access/xact.h | 14 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/include/access/rmgr.h b/src/include/access/rmgr.h index 6f018f0bee2..44b8a07a3fc 100644 --- a/src/include/access/rmgr.h +++ b/src/include/access/rmgr.h @@ -3,7 +3,7 @@ * * Resource managers definition * - * $PostgreSQL: pgsql/src/include/access/rmgr.h,v 1.18 2008/09/30 10:52:13 heikki Exp $ + * $PostgreSQL: pgsql/src/include/access/rmgr.h,v 1.19 2008/11/19 10:34:52 heikki Exp $ */ #ifndef RMGR_H #define RMGR_H @@ -23,7 +23,6 @@ typedef uint8 RmgrId; #define RM_DBASE_ID 4 #define RM_TBLSPC_ID 5 #define RM_MULTIXACT_ID 6 -#define RM_FREESPACE_ID 7 #define RM_HEAP2_ID 9 #define RM_HEAP_ID 10 #define RM_BTREE_ID 11 diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c887716e591..b6439bd2945 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/access/xact.h,v 1.95 2008/08/11 11:05:11 heikki Exp $ + * $PostgreSQL: pgsql/src/include/access/xact.h,v 1.96 2008/11/19 10:34:52 heikki Exp $ * *------------------------------------------------------------------------- */ @@ -88,10 +88,10 @@ typedef void (*SubXactCallback) (SubXactEvent event, SubTransactionId mySubid, typedef struct xl_xact_commit { TimestampTz xact_time; /* time of commit */ - int nrels; /* number of RelFileForks */ + int nrels; /* number of RelFileNodes */ int nsubxacts; /* number of subtransaction XIDs */ - /* Array of RelFileFork(s) to drop at commit */ - RelFileFork xnodes[1]; /* VARIABLE LENGTH ARRAY */ + /* Array of RelFileNode(s) to drop at commit */ + RelFileNode xnodes[1]; /* VARIABLE LENGTH ARRAY */ /* ARRAY OF COMMITTED SUBTRANSACTION XIDs FOLLOWS */ } xl_xact_commit; @@ -100,10 +100,10 @@ typedef struct xl_xact_commit typedef struct xl_xact_abort { TimestampTz xact_time; /* time of abort */ - int nrels; /* number of RelFileForks */ + int nrels; /* number of RelFileNodes */ int nsubxacts; /* number of subtransaction XIDs */ - /* Array of RelFileFork(s) to drop at abort */ - RelFileFork xnodes[1]; /* VARIABLE LENGTH ARRAY */ + /* Array of RelFileNode(s) to drop at abort */ + RelFileNode xnodes[1]; /* VARIABLE LENGTH ARRAY */ /* ARRAY OF ABORTED SUBTRANSACTION XIDs FOLLOWS */ } xl_xact_abort; |
