Skip to content

Commit 76fda61

Browse files
author
Amit Kapila
committed
Drop the temporary tuple slots allocated by pgoutput.
In pgoutput, when converting the child table's tuple format to match the parent table's, we temporarily create a new slot to store the converted tuple. However, we missed to drop such temporary slots, leading to resource leakage. Reported-by: Bowen Shi Author: Hou Zhijie Reviewed-by: Amit Kapila Backpatch-through: 15 Discussion: https://postgr.es/m/CAM_vCudv8dc3sjWiPkXx5F2b27UV7_YRKRbtSCcE-pv=cVACGA@mail.gmail.com
1 parent eb144df commit 76fda61

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/backend/replication/pgoutput/pgoutput.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,6 +1587,16 @@ pgoutput_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
15871587
ancestor = NULL;
15881588
}
15891589

1590+
/* Drop the new slots that were used to store the converted tuples. */
1591+
if (relentry->attrmap)
1592+
{
1593+
if (old_slot)
1594+
ExecDropSingleTupleTableSlot(old_slot);
1595+
1596+
if (new_slot)
1597+
ExecDropSingleTupleTableSlot(new_slot);
1598+
}
1599+
15901600
/* Cleanup */
15911601
MemoryContextSwitchTo(old);
15921602
MemoryContextReset(data->context);

0 commit comments

Comments
 (0)