From a213f1ee6c5a1bbe1f074ca201975e76ad2ed50c Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Thu, 12 Jun 2008 09:12:31 +0000 Subject: 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. --- src/backend/storage/smgr/smgr.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/backend/storage/smgr/smgr.c') 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 $ * *------------------------------------------------------------------------- */ @@ -330,6 +330,13 @@ smgrcreate(SMgrRelation reln, bool isTemp, bool isRedo) xl_smgr_create xlrec; 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. -- cgit v1.2.3