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

Commitafa8f19

Browse files
committed
Add RelationOpenSmgr() calls to ensure rd_smgr is valid when we try to
use it. While it normally has been opened earlier during btree indexbuild, testing shows that it's possible for the link to be closed againif an sinval reset occurs while the index is being built.
1 parente58a944 commitafa8f19

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎src/backend/access/nbtree/nbtsort.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
* Portions Copyright (c) 1994, Regents of the University of California
5757
*
5858
* IDENTIFICATION
59-
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.96 2005/11/22 18:17:06 momjian Exp $
59+
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.97 2006/01/07 22:45:41 tgl Exp $
6060
*
6161
*-------------------------------------------------------------------------
6262
*/
@@ -271,6 +271,9 @@ _bt_blnewpage(uint32 level)
271271
staticvoid
272272
_bt_blwritepage(BTWriteState*wstate,Pagepage,BlockNumberblkno)
273273
{
274+
/* Ensure rd_smgr is open (could have been closed by relcache flush!) */
275+
RelationOpenSmgr(wstate->index);
276+
274277
/* XLOG stuff */
275278
if (wstate->btws_use_wal)
276279
{
@@ -818,5 +821,8 @@ _bt_load(BTWriteState *wstate, BTSpool *btspool, BTSpool *btspool2)
818821
* occurs.
819822
*/
820823
if (!wstate->index->rd_istemp)
824+
{
825+
RelationOpenSmgr(wstate->index);
821826
smgrimmedsync(wstate->index->rd_smgr);
827+
}
822828
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp