forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc9b3d49
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 parentebf2ab4 commitc9b3d49
1 file changed
+2
-2
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1197 | 1197 |
| |
1198 | 1198 |
| |
1199 | 1199 |
| |
1200 |
| - | |
1201 |
| - | |
| 1200 | + | |
| 1201 | + | |
1202 | 1202 |
| |
1203 | 1203 |
| |
1204 | 1204 |
| |
|
0 commit comments
Comments
(0)