Re: REL_11_STABLE: dsm.c - cannot unpin a segment that is not pinned
Justin Pryzby <pryzby@telsasoft.com>
From: Justin Pryzby <pryzby@telsasoft.com>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: pgsql-hackers@postgresql.org
Date: 2019-02-17T19:41:45Z
Lists: pgsql-hackers
On Sat, Feb 16, 2019 at 09:16:01PM +1300, Thomas Munro wrote: > On Sat, Feb 16, 2019 at 5:31 PM Justin Pryzby <pryzby@telsasoft.com> wrote: > > Thanks, will leave it spinning overnight. No errors in ~36 hours (126 CPU-hrs), so that seems to work. Thanks. > > Do you know if any of the others should also be changed ? > > Good question, let me double check... > > > $ grep 'refcnt == 0' src/backend/storage/ipc/dsm.c > > if (refcnt == 0) > > That's dsm_cleanup_using_control_segment() and runs when starting up > before any workers can be running to clean up after a preceding crash, > so it's OK (if it's 1, meaning we crashed while that slot was going > away, we'll try to destroy it again, which is correct). Good. > > > if (dsm_control->item[i].refcnt == 0) > > That's dsm_postmaster_shutdown(), similar but at shutdown time, run by > the postmaster, and it errs on the side of trying to destroy. Good. > > > if (dsm_control->item[i].refcnt == 0) > > That's dsm_create(), and it's looking specifically for a free slot, > and that's 0 only, it'll step over used/active (refcnt > 1) and > used/going-away (refcnt == 1). Good.
Commits
-
Fix inconsistent out-of-memory error reporting in dsa.c.
- 406e937d1248 10.8 landed
- 50ae619035be 11.3 landed
- 29ddb548f683 12.0 landed
-
Fix race in dsm_unpin_segment() when handles are reused.
- 7718a9920355 10.8 landed
- 1d93d180454f 11.3 landed
- 0b55aaacec31 12.0 landed
-
Fix race in dsm_attach() when handles are reused.
- 6c0fb9418925 12.0 cited
- faf132449c0c 11.3 cited
-
Fix rare dsa_allocate() failures due to freepage.c corruption.
- 7215efdc005e 12.0 cited
-
Add WL_EXIT_ON_PM_DEATH pseudo-event.
- cfdf4dc4fc96 12.0 cited