1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-26 12:21:12 +03:00

Remove "smgr_persistence == 0" dead code.

Reaching that code would have required multiple processes performing
relation extension during recovery, which does not happen.  That caller
has the persistence available, so pass it.  This was dead code as soon
as commit 210622c60e added it.

Discussion: https://postgr.es/m/CAN55FZ0JKL6vk1xQp6rfOXiNFV1u1H0tJDPPGHWoiO3ea2Wc=A@mail.gmail.com
This commit is contained in:
Noah Misch
2024-07-20 04:22:12 -07:00
parent 22b0ccd65d
commit e00c45f685
2 changed files with 4 additions and 16 deletions

View File

@ -1002,7 +1002,7 @@ ExtendBufferedRelTo(BufferManagerRelation bmr,
if (buffer == InvalidBuffer)
{
Assert(extended_by == 0);
buffer = ReadBuffer_common(bmr.rel, bmr.smgr, 0,
buffer = ReadBuffer_common(bmr.rel, bmr.smgr, bmr.relpersistence,
fork, extend_to - 1, mode, strategy);
}
@ -1117,16 +1117,8 @@ PinBufferForBlock(Relation rel,
Assert(blockNum != P_NEW);
/*
* If there is no Relation it usually implies recovery and thus permanent,
* but we take an argument because CreateAndCopyRelationData can reach us
* with only an SMgrRelation for an unlogged relation that we don't want
* to flag with BM_PERMANENT.
*/
if (rel)
persistence = rel->rd_rel->relpersistence;
else if (smgr_persistence == 0)
persistence = RELPERSISTENCE_PERMANENT;
else
persistence = smgr_persistence;