forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7467939
committed
Fix overflow with pgstats DSA reference count
When pgstats is initialized for a backend, it uses dsa_attach_in_place()without a "segment" provided. Hence, no callback is registered toautomatically release the DSA attached once a backend exits. Not doingany cleanup causes the reference count of the pgstats DSA tocontinuously increment, at some point overflowing it (the more thenumber of connections, the faster it is to reach this state). Once thereference count overflows and then gets back to 0, new backends are notable to attach to the pgstats DSA, failing startup.This issue is resolved by adding in the pgstats shutdown hook a call todsa_release_in_place(), ensuring that the DSA attached at backendstartup is correctly released, keeping the reference count at bay.The author of this patch has been able to see this issue on a serverwith a long uptime and a high connection turnover.Issue introduced by5891c7a, so backpatch down to 15.Author: Anthonin BonnefoyDiscussion:https://postgr.es/m/CAO6_XqqJbJBL=M7Ym13TcB4Xnq58vRa2jcC+gwEPBgbAda6B1Q@mail.gmail.comBackpatch-through: 151 parentb1ffe3f commit7467939
1 file changed
+8
-0
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
246 | 246 |
| |
247 | 247 |
| |
248 | 248 |
| |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
249 | 257 |
| |
250 | 258 |
| |
251 | 259 |
| |
|
0 commit comments
Comments
(0)