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

Commite00c45f

Browse files
committed
Remove "smgr_persistence == 0" dead code.
Reaching that code would have required multiple processes performingrelation extension during recovery, which does not happen. That callerhas the persistence available, so pass it. This was dead code as soonas commit210622c added it.Discussion:https://postgr.es/m/CAN55FZ0JKL6vk1xQp6rfOXiNFV1u1H0tJDPPGHWoiO3ea2Wc=A@mail.gmail.com
1 parent22b0ccd commite00c45f

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

‎src/backend/storage/buffer/bufmgr.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ ExtendBufferedRelTo(BufferManagerRelation bmr,
10021002
if (buffer==InvalidBuffer)
10031003
{
10041004
Assert(extended_by==0);
1005-
buffer=ReadBuffer_common(bmr.rel,bmr.smgr,0,
1005+
buffer=ReadBuffer_common(bmr.rel,bmr.smgr,bmr.relpersistence,
10061006
fork,extend_to-1,mode,strategy);
10071007
}
10081008

@@ -1117,16 +1117,8 @@ PinBufferForBlock(Relation rel,
11171117

11181118
Assert(blockNum!=P_NEW);
11191119

1120-
/*
1121-
* If there is no Relation it usually implies recovery and thus permanent,
1122-
* but we take an argument because CreateAndCopyRelationData can reach us
1123-
* with only an SMgrRelation for an unlogged relation that we don't want
1124-
* to flag with BM_PERMANENT.
1125-
*/
11261120
if (rel)
11271121
persistence=rel->rd_rel->relpersistence;
1128-
elseif (smgr_persistence==0)
1129-
persistence=RELPERSISTENCE_PERMANENT;
11301122
else
11311123
persistence=smgr_persistence;
11321124

‎src/include/storage/bufmgr.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,10 @@ typedef struct BufferManagerRelation
114114

115115
structReadBuffersOperation
116116
{
117-
/*
118-
* The following members should be set by the caller. If only smgr is
119-
* provided without rel, then smgr_persistence can be set to override the
120-
* default assumption of RELPERSISTENCE_PERMANENT.
121-
*/
122-
Relationrel;
117+
/* The following members should be set by the caller. */
118+
Relationrel;/* optional */
123119
structSMgrRelationData*smgr;
124-
charsmgr_persistence;
120+
charsmgr_persistence;/* optional if rel != NULL */
125121
ForkNumberforknum;
126122
BufferAccessStrategystrategy;
127123

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp