diff options
author | Jeff Davis <jdavis@postgresql.org> | 2023-02-20 10:29:53 -0800 |
---|---|---|
committer | Jeff Davis <jdavis@postgresql.org> | 2023-02-20 11:07:24 -0800 |
commit | 69e8c7cf1dfa08ae099c33d0d371ad69d405903d (patch) | |
tree | cb5da77d019e67bdbdebb6a4bc02c1107871b156 /src/backend/executor/nodeModifyTable.c | |
parent | c6c3b3bc3de1be016de646403b923c1c8a2521cb (diff) | |
download | postgresql-69e8c7cf1dfa08ae099c33d0d371ad69d405903d.tar.gz postgresql-69e8c7cf1dfa08ae099c33d0d371ad69d405903d.zip |
Limit memory usage of pg_walinspect functions.
GetWALRecordsInfo() and pg_get_wal_fpi_info() can leak memory across
WAL record iterations. Fix this by using a temporary memory context
that's reset for each WAL record iteraion.
Also a use temporary context for loops in GetXLogSummaryStats(). The
number of iterations is a small constant, so the previous behavior was
not a leak, but fix for clarity (but no need to backport).
Backport GetWALRecordsInfo() change to version
15. pg_get_wal_fpi_info() didn't exist in version 15.
Reported-by: Peter Geoghegan
Author: Bharath Rupireddy
Discussion: https://www.postgresql.org/message-id/CAH2-WznLEJjn7ghmKOABOEZYuJvkTk%3DGKU3m0%2B-XBAH%2BerPiJQ%40mail.gmail.com
Backpatch-through: 15
Diffstat (limited to 'src/backend/executor/nodeModifyTable.c')
0 files changed, 0 insertions, 0 deletions