Fix memory leak in pgoutput for the WAL sender RelationSyncCache, the hash table in charge of tracking the relation schemas sent through pgoutput, was forgetting to free the TupleDesc associated to the two slots used to store the new and old tuples, causing some memory to be leaked each time a relation is invalidated when the slots of an existing relation entry are cleaned up.
This is rather hard to notice as the bloat is pretty minimal, but a long-running WAL sender would be in trouble over time depending on the workload. sysbench has proved to be pretty good at showing the problem, coupled with some memory monitoring of the WAL sender. Issue introduced in 52e4f0cd472d, that has added row filters for tables logically replicated. Author: Boyu Yang Reviewed-by: Michael Paquier, Hou Zhijie Discussion: https://postgr.es/m/dm3pr84mb3442e14b340e553313b5c816e3...@dm3pr84mb3442.namprd84.prod.outlook.com Backpatch-through: 15 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/6fc30c24cb7f648a4997c7508333bbe7f5a7de9c Modified Files -------------- src/backend/replication/pgoutput/pgoutput.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)