forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit806fad7
committed
Fix buffer refcount leak with FDW bulk inserts
The leak would show up when using batch inserts with foreign tablesincluded in a partition tree, as the slots used in the batch were notreset once processed. In order to fix this problem, someExecClearTuple() are added to clean up the slots used once a batch isfilled and processed, mapping with the number of slots currently in useas tracked by the counter ri_NumSlots.This buffer refcount leak has been introduced inb676ac4 with theaddition of the executor facility to improve bulk inserts for FDWs, sobackpatch down to 14.Alexander has provided the patch (slightly modified by me). The testfor postgres_fdw comes from me, based on the test case that the authorhas sent in the report.Author: Alexander PyhalovDiscussion:https://postgr.es/m/b035780a740efd38dc30790c76927255@postgrespro.ruBackpatch-through: 141 parent1118cd3 commit806fad7
File tree
3 files changed
+48
-2
lines changed- contrib/postgres_fdw
- expected
- sql
- src/backend/executor
3 files changed
+48
-2
lines changedLines changed: 22 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6930 | 6930 |
| |
6931 | 6931 |
| |
6932 | 6932 |
| |
| 6933 | + | |
| 6934 | + | |
| 6935 | + | |
| 6936 | + | |
| 6937 | + | |
| 6938 | + | |
| 6939 | + | |
| 6940 | + | |
| 6941 | + | |
| 6942 | + | |
| 6943 | + | |
| 6944 | + | |
| 6945 | + | |
| 6946 | + | |
| 6947 | + | |
| 6948 | + | |
| 6949 | + | |
| 6950 | + | |
| 6951 | + | |
| 6952 | + | |
| 6953 | + | |
| 6954 | + | |
6933 | 6955 |
| |
6934 | 6956 |
| |
6935 | 6957 |
| |
|
Lines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1657 | 1657 |
| |
1658 | 1658 |
| |
1659 | 1659 |
| |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
1660 | 1678 |
| |
1661 | 1679 |
| |
1662 | 1680 |
| |
|
Lines changed: 8 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
856 | 856 |
| |
857 | 857 |
| |
858 | 858 |
| |
859 |
| - | |
860 | 859 |
| |
861 | 860 |
| |
862 | 861 |
| |
| |||
1261 | 1260 |
| |
1262 | 1261 |
| |
1263 | 1262 |
| |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
1264 | 1271 |
| |
1265 | 1272 |
| |
1266 | 1273 |
| |
| |||
1284 | 1291 |
| |
1285 | 1292 |
| |
1286 | 1293 |
| |
1287 |
| - | |
1288 | 1294 |
| |
1289 | 1295 |
| |
1290 | 1296 |
| |
|
0 commit comments
Comments
(0)