postgresql/contrib/test_decoding
Andres Freund 5f79580ad6 Fix memory lifetime issues of replication slot stats.
When accessing replication slot stats, introduced in 9868167500,
pgstat_read_statsfiles() reads the data into newly allocated
memory. Unfortunately the current memory context at that point is the
callers, leading to leaks and use-after-free dangers.

The fix is trivial, explicitly use pgStatLocalContext. There's some
potential for further improvements, but that's outside of the scope of
this bugfix.

No backpatch necessary, feature is only in HEAD.

Author: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/20210317230447.c7uc4g3vbs4wi32i@alap3.anarazel.de
2021-03-17 16:21:46 -07:00
..
expected Fix memory lifetime issues of replication slot stats. 2021-03-17 16:21:46 -07:00
specs Add option to enable two_phase commits via pg_create_logical_replication_slot. 2021-03-03 07:34:11 +05:30
sql Fix memory lifetime issues of replication slot stats. 2021-03-17 16:21:46 -07:00
.gitignore Improve isolation tests infrastructure. 2017-03-14 15:56:17 -07:00
Makefile Test decoding of two-phase transactions during the build of a consistent snapshot. 2021-01-05 15:05:22 +05:30
logical.conf Add logical_decoding_work_mem to limit ReorderBuffer memory usage. 2019-11-19 07:32:36 +05:30
test_decoding.c Add option to enable two_phase commits via pg_create_logical_replication_slot. 2021-03-03 07:34:11 +05:30