aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlogutils.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-01-10 20:02:24 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-01-10 20:02:24 +0000
commit0ce4d56924982c04da226bc890033e377d1ef375 (patch)
tree7bea17dae3daf0483526989590035a52af6db8bc /src/backend/access/transam/xlogutils.c
parentcc7cd8774a644bfb484ee31320e85764ba68d1e3 (diff)
downloadpostgresql-0ce4d56924982c04da226bc890033e377d1ef375.tar.gz
postgresql-0ce4d56924982c04da226bc890033e377d1ef375.zip
Phase 1 of fix for 'SMgrRelation hashtable corrupted' problem. This
is the minimum required fix. I want to look next at taking advantage of it by simplifying the message semantics in the shared inval message queue, but that part can be held over for 8.1 if it turns out too ugly.
Diffstat (limited to 'src/backend/access/transam/xlogutils.c')
-rw-r--r--src/backend/access/transam/xlogutils.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/backend/access/transam/xlogutils.c b/src/backend/access/transam/xlogutils.c
index 08583d3d6e0..251098d4083 100644
--- a/src/backend/access/transam/xlogutils.c
+++ b/src/backend/access/transam/xlogutils.c
@@ -11,7 +11,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/xlogutils.c,v 1.35 2004/12/31 21:59:30 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xlogutils.c,v 1.36 2005/01/10 20:02:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -125,8 +125,7 @@ _xl_remove_hash_entry(XLogRelDesc *rdesc)
if (hentry == NULL)
elog(PANIC, "_xl_remove_hash_entry: file was not found in cache");
- if (rdesc->reldata.rd_smgr != NULL)
- smgrclose(rdesc->reldata.rd_smgr);
+ RelationCloseSmgr(&(rdesc->reldata));
memset(rdesc, 0, sizeof(XLogRelDesc));
memset(tpgc, 0, sizeof(FormData_pg_class));
@@ -233,7 +232,8 @@ XLogOpenRelation(bool redo, RmgrId rmid, RelFileNode rnode)
hentry->rdesc = res;
res->reldata.rd_targblock = InvalidBlockNumber;
- res->reldata.rd_smgr = smgropen(res->reldata.rd_node);
+ res->reldata.rd_smgr = NULL;
+ RelationOpenSmgr(&(res->reldata));
/*
* Create the target file if it doesn't already exist. This lets
@@ -278,7 +278,5 @@ XLogCloseRelation(RelFileNode rnode)
rdesc = hentry->rdesc;
- if (rdesc->reldata.rd_smgr != NULL)
- smgrclose(rdesc->reldata.rd_smgr);
- rdesc->reldata.rd_smgr = NULL;
+ RelationCloseSmgr(&(rdesc->reldata));
}