Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7d738f9

Browse files
author
Hiroshi Inoue
committed
Remove ugly call ImmediateSharedRelationCacheInvalidate()
from md.c.
1 parent 4acf890 commit 7d738f9

File tree

1 file changed

+1
-25
lines changed
  • src/backend/storage/smgr

1 file changed

+1
-25
lines changed

src/backend/storage/smgr/md.c

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.63 2000/01/26 05:57:05 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.64 2000/02/07 02:38:18 inoue Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -205,15 +205,6 @@ mdunlink(Relation reln)
205205
*/
206206
if (reln->rd_unlinked && reln->rd_fd < 0)
207207
return SM_SUCCESS;
208-
/*
209-
* This call isn't good for independency of md stuff,but
210-
* mdunlink() unlinks the base file immediately and couldn't
211-
* be rollbacked in case of abort. We must guarantee all
212-
* backends' relation cache invalidation here.
213-
* This would be unnecessary if unlinking is postponed
214-
* till end of transaction.
215-
*/
216-
ImmediateSharedRelationCacheInvalidate(reln);
217208
/*
218209
* Force all segments of the relation to be opened, so that we
219210
* won't miss deleting any of them.
@@ -786,7 +777,6 @@ mdtruncate(Relation reln, int nblocks)
786777
#ifndef LET_OS_MANAGE_FILESIZE
787778
MemoryContext oldcxt;
788779
int priorblocks;
789-
bool invalregistered = false;
790780
#endif
791781

792782
/* NOTE: mdnblocks makes sure we have opened all existing segments,
@@ -818,20 +808,6 @@ mdtruncate(Relation reln, int nblocks)
818808
* a big file...
819809
*/
820810
FileTruncate(v->mdfd_vfd, 0);
821-
/*
822-
* To call ImmediateSharedRelationCacheInvalidate() here
823-
* isn't good for independency of md stuff,but smgrunlink()
824-
* removes the base file immediately and couldn't be
825-
* rollbacked in case of abort. We must guarantee
826-
* all backends' relation cache invalidation here.
827-
* This would be unnecessary if the truncation is postponed
828-
* till end of transaction.
829-
*/
830-
if (!invalregistered)
831-
{
832-
ImmediateSharedRelationCacheInvalidate(reln);
833-
invalregistered = true;
834-
}
835811
FileUnlink(v->mdfd_vfd);
836812
v = v->mdfd_chain;
837813
Assert(ov != &Md_fdvec[fd]); /* we never drop the 1st segment */

0 commit comments

Comments
 (0)