Commit 415ffdc
committed
Don't run RelationInitTableAccessMethod in a long-lived context.
Some code paths in this function perform syscache lookups, which
can lead to table accesses and possibly leakage of cruft into
the caller's context. If said context is CacheMemoryContext,
we eventually will have visible bloat. But fixing this is no
harder than moving one memory context switch step. (The other
callers don't have a problem.)
Andres Freund and I independently found this via valgrind testing.
Back-patch to v12 where this code was added.
Discussion: https://postgr.es/m/20210317023101.anvejcfotwka6gaa@alap3.anarazel.de
Discussion: https://postgr.es/m/3816764.1616104288@sss.pgh.pa.us1 parent 28644fa commit 415ffdc
1 file changed
+7
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3543 | 3543 | | |
3544 | 3544 | | |
3545 | 3545 | | |
| 3546 | + | |
| 3547 | + | |
| 3548 | + | |
| 3549 | + | |
| 3550 | + | |
| 3551 | + | |
| 3552 | + | |
3546 | 3553 | | |
3547 | 3554 | | |
3548 | 3555 | | |
| |||
3566 | 3573 | | |
3567 | 3574 | | |
3568 | 3575 | | |
3569 | | - | |
3570 | | - | |
3571 | | - | |
3572 | | - | |
3573 | | - | |
3574 | 3576 | | |
3575 | 3577 | | |
3576 | 3578 | | |
| |||
0 commit comments