diff options
author | Thomas Munro <tmunro@postgresql.org> | 2019-02-18 09:53:26 +1300 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2019-02-18 10:02:37 +1300 |
commit | 7718a992035501933cb4359d075908075da22f1f (patch) | |
tree | 97d4d7fd79523ed95015859d6b83b5c66aa8c892 /src/backend/commands/constraint.c | |
parent | c1769970499833e451d0125ed1bc43d116ad3160 (diff) | |
download | postgresql-7718a992035501933cb4359d075908075da22f1f.tar.gz postgresql-7718a992035501933cb4359d075908075da22f1f.zip |
Fix race in dsm_unpin_segment() when handles are reused.
Teach dsm_unpin_segment() to skip segments that are in the process
of being destroyed by another backend, when searching for a handle.
Such a segment cannot possibly be the one we are looking for, even
if its handle matches. Another slot might hold a recently created
segment that has the same handle value by coincidence, and we need
to keep searching for that one.
The bug caused rare "cannot unpin a segment that is not pinned"
errors on 10 and 11. Similar to commit 6c0fb941 for dsm_attach().
Back-patch to 10, where dsm_unpin_segment() landed.
Author: Thomas Munro
Reported-by: Justin Pryzby
Tested-by: Justin Pryzby (along with other recent DSA/DSM fixes)
Discussion: https://postgr.es/m/20190216023854.GF30291@telsasoft.com
Diffstat (limited to 'src/backend/commands/constraint.c')
0 files changed, 0 insertions, 0 deletions