diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2008-06-12 09:12:31 +0000 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2008-06-12 09:12:31 +0000 |
commit | a213f1ee6c5a1bbe1f074ca201975e76ad2ed50c (patch) | |
tree | c5ac3531c006389123da3ba506e5b25eb09ecd02 /src/backend/storage/smgr/smgr.c | |
parent | c4f2a0458dc029d1214f013f1434f70f5194e56d (diff) | |
download | postgresql-a213f1ee6c5a1bbe1f074ca201975e76ad2ed50c.tar.gz postgresql-a213f1ee6c5a1bbe1f074ca201975e76ad2ed50c.zip |
Refactor XLogOpenRelation() and XLogReadBuffer() in preparation for relation
forks. XLogOpenRelation() and the associated light-weight relation cache in
xlogutils.c is gone, and XLogReadBuffer() now takes a RelFileNode as argument,
instead of Relation.
For functions that still need a Relation struct during WAL replay, there's a
new function called CreateFakeRelcacheEntry() that returns a fake entry like
XLogOpenRelation() used to.
Diffstat (limited to 'src/backend/storage/smgr/smgr.c')
-rw-r--r-- | src/backend/storage/smgr/smgr.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/storage/smgr/smgr.c b/src/backend/storage/smgr/smgr.c index 3f57a2d1b39..d0282f8a6d7 100644 --- a/src/backend/storage/smgr/smgr.c +++ b/src/backend/storage/smgr/smgr.c @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/smgr/smgr.c,v 1.109 2008/01/01 19:45:52 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/storage/smgr/smgr.c,v 1.110 2008/06/12 09:12:31 heikki Exp $ * *------------------------------------------------------------------------- */ @@ -331,6 +331,13 @@ smgrcreate(SMgrRelation reln, bool isTemp, bool isRedo) PendingRelDelete *pending; /* + * Exit quickly in WAL replay mode if we've already opened the file. + * If it's open, it surely must exist. + */ + if (isRedo && reln->md_fd != NULL) + return; + + /* * We may be using the target table space for the first time in this * database, so create a per-database subdirectory if needed. * |