forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8364354
committed
Fix memory leak in pgoutput with relation attribute map
pgoutput caches the attribute map of a relation, that is free()'d onlywhen validating a RelationSyncEntry. However, this code path is nottaken when calling any of the SQL functions able to do some logicaldecoding, like pg_logical_slot_{get,peek}_changes(), leaking some memoryinto CacheMemoryContext on repeated calls.To address this, a relation's attribute map is allocated inPGOutputData's cachectx, free()'d at the end of the execution of theseSQL functions when logical decoding ends. This is available down to 15.v13 and v14 have a similar leak, which will be dealt with later.Reported-by: Masahiko SawadaAuthor: Vignesh CReviewed-by: Hou ZhijieDiscussion:https://postgr.es/m/CAD21AoDkAhQVSukOfH3_reuF-j4EU0-HxMqU3dU+bSTxsqT14Q@mail.gmail.comDiscussion:https://postgr.es/m/CALDaNm1hewNAsZ_e6FF52a=9drmkRJxtEPrzCB6-9mkJyeBBqA@mail.gmail.comBackpatch-through: 151 parentc3de0f9 commit8364354
1 file changed
+2
-2
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1184 | 1184 |
| |
1185 | 1185 |
| |
1186 | 1186 |
| |
1187 |
| - | |
1188 |
| - | |
| 1187 | + | |
| 1188 | + | |
1189 | 1189 |
| |
1190 | 1190 |
| |
1191 | 1191 |
| |
|
0 commit comments
Comments
(0)