- Notifications
You must be signed in to change notification settings - Fork4.9k
Commite087b5b
committed
Fix per-relation memory leakage in autovacuum.
PgStat_StatTabEntry and AutoVacOpts structs were leaked untilthe end of the autovacuum worker's run, which is bad news ifthere are a lot of relations in the database.Note: pfree'ing the PgStat_StatTabEntry structs here seems a bitrisky, because pgstat_fetch_stat_tabentry_ext does not guaranteeanything about whether its result is long-lived. It appears okayso long as autovacuum forces PGSTAT_FETCH_CONSISTENCY_NONE, butI think that API could use a re-think.Also ensure that the VacuumRelation structure passed tovacuum() is in recoverable storage.Back-patch to v15 where we started to manage table statisticsthis way. (The AutoVacOpts leakage is probably older, butI'm not excited enough to worry about just that part.)Author: Tom Lane <tgl@sss.pgh.pa.us>Reviewed-by: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/285483.1746756246@sss.pgh.pa.usBackpatch-through: 151 parentee58de1 commite087b5b
1 file changed
+40
-10
lines changedLines changed: 40 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2211 | 2211 |
| |
2212 | 2212 |
| |
2213 | 2213 |
| |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
2214 | 2220 |
| |
2215 | 2221 |
| |
2216 | 2222 |
| |
| |||
2227 | 2233 |
| |
2228 | 2234 |
| |
2229 | 2235 |
| |
2230 |
| - | |
| 2236 | + | |
| 2237 | + | |
2231 | 2238 |
| |
2232 | 2239 |
| |
2233 | 2240 |
| |
| |||
2245 | 2252 |
| |
2246 | 2253 |
| |
2247 | 2254 |
| |
2248 |
| - | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
2249 | 2258 |
| |
2250 | 2259 |
| |
2251 | 2260 |
| |
| |||
2266 | 2275 |
| |
2267 | 2276 |
| |
2268 | 2277 |
| |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
2269 | 2284 |
| |
2270 | 2285 |
| |
2271 | 2286 |
| |
| |||
2637 | 2652 |
| |
2638 | 2653 |
| |
2639 | 2654 |
| |
| 2655 | + | |
| 2656 | + | |
2640 | 2657 |
| |
2641 | 2658 |
| |
2642 | 2659 |
| |
| |||
2818 | 2835 |
| |
2819 | 2836 |
| |
2820 | 2837 |
| |
2821 |
| - | |
2822 |
| - | |
| 2838 | + | |
| 2839 | + | |
2823 | 2840 |
| |
2824 | 2841 |
| |
2825 | 2842 |
| |
| |||
2868 | 2885 |
| |
2869 | 2886 |
| |
2870 | 2887 |
| |
| 2888 | + | |
2871 | 2889 |
| |
2872 | 2890 |
| |
2873 | 2891 |
| |
| |||
2880 | 2898 |
| |
2881 | 2899 |
| |
2882 | 2900 |
| |
2883 |
| - | |
2884 |
| - | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
2885 | 2905 |
| |
2886 | 2906 |
| |
2887 | 2907 |
| |
| |||
2983 | 3003 |
| |
2984 | 3004 |
| |
2985 | 3005 |
| |
| 3006 | + | |
| 3007 | + | |
2986 | 3008 |
| |
2987 | 3009 |
| |
2988 | 3010 |
| |
| |||
3014 | 3036 |
| |
3015 | 3037 |
| |
3016 | 3038 |
| |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
3017 | 3043 |
| |
3018 | 3044 |
| |
3019 | 3045 |
| |
| |||
3236 | 3262 |
| |
3237 | 3263 |
| |
3238 | 3264 |
| |
| 3265 | + | |
3239 | 3266 |
| |
3240 | 3267 |
| |
3241 | 3268 |
| |
3242 | 3269 |
| |
| 3270 | + | |
| 3271 | + | |
| 3272 | + | |
| 3273 | + | |
| 3274 | + | |
3243 | 3275 |
| |
| 3276 | + | |
3244 | 3277 |
| |
3245 | 3278 |
| |
3246 | 3279 |
| |
3247 |
| - | |
3248 |
| - | |
3249 |
| - | |
3250 |
| - | |
| 3280 | + | |
3251 | 3281 |
| |
3252 | 3282 |
| |
3253 | 3283 |
| |
|
0 commit comments
Comments
(0)