pgsql: Don't run RelationInitTableAccessMethod in a long-lived context.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Don't run RelationInitTableAccessMethod in a long-lived context.
Дата
Msg-id E1lN4nd-0001oL-IX@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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.us

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1452a0bb87c78812372f103de14cb6492a932ac6

Modified Files
--------------
src/backend/utils/cache/relcache.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: pgsql: Fix TAP test for remove_temp_files_after_crash
Следующее
От: Fujii Masao
Дата:
Сообщение: pgsql: Fix comments in postmaster.c.