Content-Length: 256605 | pFad | http://github.com/postgrespro/postgres/commit/81e36d3e0df8d3d7a3daa2e2216f96df23ffc96a

3D Invalidate smgr_targblock in smgrrelease(). · postgrespro/postgres@81e36d3 · GitHub
Skip to content

Commit 81e36d3

Browse files
committed
Invalidate smgr_targblock in smgrrelease().
In rare circumstances involving relfilenode reuse, it might have been possible for smgr_targblock to finish up pointing past the end. Oversight in b74e94d. Back-patch to 15. Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi> Discussion: https://postgr.es/m/CA%2BhUKGJ8NTvqLHz6dqbQnt2c8XCki4r2QvXjBQcXpVwxTY_pvA%40mail.gmail.com
1 parent d3c25ca commit 81e36d3

File tree

1 file changed

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

1 file changed

+1
-0
lines changed

src/backend/storage/smgr/smgr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ smgrrelease(SMgrRelation reln)
296296
smgrsw[reln->smgr_which].smgr_close(reln, forknum);
297297
reln->smgr_cached_nblocks[forknum] = InvalidBlockNumber;
298298
}
299+
reln->smgr_targblock = InvalidBlockNumber;
299300
}
300301

301302
/*

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/81e36d3e0df8d3d7a3daa2e2216f96df23ffc96a

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy