Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3503f19

Browse files
committed
RelationClearRelation must reset rd_targblock and update rd_nblocks
even when dealing with a nailed-in-cache relation; otherwise, followingVACUUM truncation of a system catalog, other backends might haveunreasonably large values of these fields.
1 parent286fb25 commit3503f19

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎src/backend/utils/cache/relcache.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.175 2002/09/04 20:31:30 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.176 2002/09/22 20:56:28 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1685,10 +1685,14 @@ RelationClearRelation(Relation relation, bool rebuild)
16851685

16861686
/*
16871687
* Never, never ever blow away a nailed-in system relation, because
1688-
* we'd be unable to recover.
1688+
* we'd be unable to recover. However, we must update rd_nblocks
1689+
* and reset rd_targblock, in case we got called because of a relation
1690+
* cache flush that was triggered by VACUUM.
16891691
*/
16901692
if (relation->rd_isnailed)
16911693
{
1694+
relation->rd_targblock=InvalidBlockNumber;
1695+
RelationUpdateNumberOfBlocks(relation);
16921696
#ifdefENABLE_REINDEX_NAILED_RELATIONS
16931697
RelationReloadClassinfo(relation);
16941698
#endif/* ENABLE_REINDEX_NAILED_RELATIONS */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp