pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix race in dsm_unpin_segment() when handles are reused.
3+ messages / 1 participants
[nested] [flat]

* pgsql: Fix race in dsm_unpin_segment() when handles are reused.
@ 2019-02-17 21:06 Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Thomas Munro @ 2019-02-17 21:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0b55aaacec313c309e21f63d9ff5733c3f8ab813

Modified Files
--------------
src/backend/storage/ipc/dsm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix race in dsm_unpin_segment() when handles are reused.
@ 2019-02-17 21:06 Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Thomas Munro @ 2019-02-17 21:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1d93d180454f9da74677dd0498f5408efe6b603d

Modified Files
--------------
src/backend/storage/ipc/dsm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix race in dsm_unpin_segment() when handles are reused.
@ 2019-02-17 21:06 Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Thomas Munro @ 2019-02-17 21:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7718a992035501933cb4359d075908075da22f1f

Modified Files
--------------
src/backend/storage/ipc/dsm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2019-02-17 21:06 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-02-17 21:06 pgsql: Fix race in dsm_unpin_segment() when handles are reused. Thomas Munro <tmunro@postgresql.org>
2019-02-17 21:06 pgsql: Fix race in dsm_unpin_segment() when handles are reused. Thomas Munro <tmunro@postgresql.org>
2019-02-17 21:06 pgsql: Fix race in dsm_unpin_segment() when handles are reused. Thomas Munro <tmunro@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox