mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
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.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.243 2004/12/31 21:59:38 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.244 2005/01/10 20:02:19 tgl Exp $
|
||||
*
|
||||
*
|
||||
* INTERFACE ROUTINES
|
||||
@@ -780,11 +780,9 @@ index_drop(Oid indexId)
|
||||
*/
|
||||
FlushRelationBuffers(userIndexRelation, (BlockNumber) 0);
|
||||
|
||||
if (userIndexRelation->rd_smgr == NULL)
|
||||
userIndexRelation->rd_smgr = smgropen(userIndexRelation->rd_node);
|
||||
RelationOpenSmgr(userIndexRelation);
|
||||
smgrscheduleunlink(userIndexRelation->rd_smgr,
|
||||
userIndexRelation->rd_istemp);
|
||||
userIndexRelation->rd_smgr = NULL;
|
||||
|
||||
/*
|
||||
* Close and flush the index's relcache entry, to ensure relcache
|
||||
@@ -1133,10 +1131,8 @@ setNewRelfilenode(Relation relation)
|
||||
smgrclose(srel);
|
||||
|
||||
/* schedule unlinking old relfilenode */
|
||||
if (relation->rd_smgr == NULL)
|
||||
relation->rd_smgr = smgropen(relation->rd_node);
|
||||
RelationOpenSmgr(relation);
|
||||
smgrscheduleunlink(relation->rd_smgr, relation->rd_istemp);
|
||||
relation->rd_smgr = NULL;
|
||||
|
||||
/* update the pg_class row */
|
||||
rd_rel->relfilenode = newrelfilenode;
|
||||
|
||||
Reference in New Issue
Block a user