diff options
author | Michael Paquier <michael@paquier.xyz> | 2025-09-10 07:23:05 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2025-09-10 07:23:05 +0900 |
commit | 8c8f7b199d9095dbc2e101a4614043b5ae13bde3 (patch) | |
tree | ecea4516f37384c123f1716688088ba4ea66af9a /src/backend/utils/adt/pseudorandomfuncs.c | |
parent | d96c854dfc634212193007ca58f8978bc272d457 (diff) |
Fix leak with SMgrRelations in startup process
The startup process does not process shared invalidation messages, only
sending them, and never calls AtEOXact_SMgr() which clean up any
unpinned SMgrRelations. Hence, it is never able to free SMgrRelations
on a periodic basis, bloating its hashtable over time.
Like the checkpointer and the bgwriter, this commit takes a conservative
approach by freeing periodically SMgrRelations when replaying a
checkpoint record, either online or shutdown, so as the startup process
has a way to perform a periodic cleanup.
Issue caused by 21d9c3ee4ef7, so backpatch down to v17.
Author: Jingtang Zhang <mrdrivingduck@gmail.com>
Reviewed-by: Yuhang Qiu <iamqyh@gmail.com>
Discussion: https://postgr.es/m/28C687D4-F335-417E-B06C-6612A0BD5A10@gmail.com
Backpatch-through: 17
Diffstat (limited to 'src/backend/utils/adt/pseudorandomfuncs.c')
0 files changed, 0 insertions, 0 deletions