forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3ce761d
committed
Fix memory leak in Incremental Sort rescans
The Incremental Sort had a couple issues, resulting in leaking memoryduring rescans, possibly triggering OOM. The code had a couple ofrelated flaws:1. During rescans, the sort states were reset but then also set to NULL (despite the comment saying otherwise). ExecIncrementalSort then sees NULL and initializes a new sort state, leaking the memory used by the old one.2. Initializing the sort state also automatically rebuilt the info about presorted keys, leaking the already initialized info. presorted_keys was also unnecessarily reset to NULL.Patch by James Coleman, based on patches by Laurenz Albe and Tom Lane.Backpatch to 13, where Incremental Sort was introduced.Author: James Coleman, Laurenz Albe, Tom LaneReported-by: Laurenz Albe, Zu-Ming JiangBackpatch-through: 13Discussion:https://postgr.es/m/b2bd02dff61af15e3526293e2771f874cf2a3be7.camel%40cybertec.atDiscussion:https://postgr.es/m/db03c582-086d-e7cd-d4a1-3bc722f81765%40inf.ethz.ch1 parent537b70b commit3ce761d
1 file changed
+0
-7
lines changedLines changed: 0 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1138 | 1138 |
| |
1139 | 1139 |
| |
1140 | 1140 |
| |
1141 |
| - | |
1142 | 1141 |
| |
1143 | 1142 |
| |
1144 | 1143 |
| |
| |||
1151 | 1150 |
| |
1152 | 1151 |
| |
1153 | 1152 |
| |
1154 |
| - | |
1155 | 1153 |
| |
1156 |
| - | |
1157 |
| - | |
1158 | 1154 |
| |
1159 |
| - | |
1160 | 1155 |
| |
1161 |
| - | |
1162 |
| - | |
1163 | 1156 |
| |
1164 | 1157 |
| |
1165 | 1158 |
| |
|
0 commit comments
Comments
(0)