mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
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.
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user