pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix inadequate buffer locking in FSM and VM page re-initializati
7+ messages / 1 participants
[nested] [flat]

* pgsql: Fix inadequate buffer locking in FSM and VM page re-initializati
@ 2018-07-13 15:53  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2018-07-13 15:53 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix inadequate buffer locking in FSM and VM page re-initialization.

When reading an existing FSM or VM page that was found to be corrupt by the
buffer manager, the code applied PageInit() to reinitialize the page, but
did so without any locking.  There is thus a hazard that two backends might
concurrently do PageInit, which in itself would still be OK, but the slower
one might then zero over subsequent data changes applied by the faster one.
Even that is unlikely to be fatal; but it's not desirable, so add locking
to prevent it.

This does not add any locking overhead in the normal code path where the
page is OK.  It's not immediately obvious that that's safe, but I believe
it is, for reasons explained in the added comments.

Problem noted by R P Asim.  It's been like this for a long time, so
back-patch to all supported branches.

Discussion: https://postgr.es/m/CANXE4Te4G0TGq6cr0-TvwP0H4BNiK_-hB5gHe8mF+nz0mcYfMQ@mail.gmail.com

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5586e42b349346df5d88f71a5a41d8cb76b8c491

Modified Files
--------------
src/backend/access/heap/visibilitymap.c   | 21 ++++++++++++++++++++-
src/backend/storage/freespace/freespace.c | 21 ++++++++++++++++++++-
2 files changed, 40 insertions(+), 2 deletions(-)



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

* pgsql: Fix inadequate buffer locking in FSM and VM page re-initializati
@ 2018-07-13 15:53  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2018-07-13 15:53 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix inadequate buffer locking in FSM and VM page re-initialization.

When reading an existing FSM or VM page that was found to be corrupt by the
buffer manager, the code applied PageInit() to reinitialize the page, but
did so without any locking.  There is thus a hazard that two backends might
concurrently do PageInit, which in itself would still be OK, but the slower
one might then zero over subsequent data changes applied by the faster one.
Even that is unlikely to be fatal; but it's not desirable, so add locking
to prevent it.

This does not add any locking overhead in the normal code path where the
page is OK.  It's not immediately obvious that that's safe, but I believe
it is, for reasons explained in the added comments.

Problem noted by R P Asim.  It's been like this for a long time, so
back-patch to all supported branches.

Discussion: https://postgr.es/m/CANXE4Te4G0TGq6cr0-TvwP0H4BNiK_-hB5gHe8mF+nz0mcYfMQ@mail.gmail.com

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f1963a1e79a499c2cf362fa41206a3b9e4348a54

Modified Files
--------------
src/backend/access/heap/visibilitymap.c   | 21 ++++++++++++++++++++-
src/backend/storage/freespace/freespace.c | 21 ++++++++++++++++++++-
2 files changed, 40 insertions(+), 2 deletions(-)



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

* pgsql: Fix inadequate buffer locking in FSM and VM page re-initializati
@ 2018-07-13 15:53  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2018-07-13 15:53 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix inadequate buffer locking in FSM and VM page re-initialization.

When reading an existing FSM or VM page that was found to be corrupt by the
buffer manager, the code applied PageInit() to reinitialize the page, but
did so without any locking.  There is thus a hazard that two backends might
concurrently do PageInit, which in itself would still be OK, but the slower
one might then zero over subsequent data changes applied by the faster one.
Even that is unlikely to be fatal; but it's not desirable, so add locking
to prevent it.

This does not add any locking overhead in the normal code path where the
page is OK.  It's not immediately obvious that that's safe, but I believe
it is, for reasons explained in the added comments.

Problem noted by R P Asim.  It's been like this for a long time, so
back-patch to all supported branches.

Discussion: https://postgr.es/m/CANXE4Te4G0TGq6cr0-TvwP0H4BNiK_-hB5gHe8mF+nz0mcYfMQ@mail.gmail.com

Branch
------
REL9_3_STABLE

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

Modified Files
--------------
src/backend/access/heap/visibilitymap.c   | 21 ++++++++++++++++++++-
src/backend/storage/freespace/freespace.c | 21 ++++++++++++++++++++-
2 files changed, 40 insertions(+), 2 deletions(-)



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

* pgsql: Fix inadequate buffer locking in FSM and VM page re-initializati
@ 2018-07-13 15:53  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2018-07-13 15:53 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix inadequate buffer locking in FSM and VM page re-initialization.

When reading an existing FSM or VM page that was found to be corrupt by the
buffer manager, the code applied PageInit() to reinitialize the page, but
did so without any locking.  There is thus a hazard that two backends might
concurrently do PageInit, which in itself would still be OK, but the slower
one might then zero over subsequent data changes applied by the faster one.
Even that is unlikely to be fatal; but it's not desirable, so add locking
to prevent it.

This does not add any locking overhead in the normal code path where the
page is OK.  It's not immediately obvious that that's safe, but I believe
it is, for reasons explained in the added comments.

Problem noted by R P Asim.  It's been like this for a long time, so
back-patch to all supported branches.

Discussion: https://postgr.es/m/CANXE4Te4G0TGq6cr0-TvwP0H4BNiK_-hB5gHe8mF+nz0mcYfMQ@mail.gmail.com

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6d2d5ab173a9b4a131827313522451dff3fb4ac1

Modified Files
--------------
src/backend/access/heap/visibilitymap.c   | 21 ++++++++++++++++++++-
src/backend/storage/freespace/freespace.c | 21 ++++++++++++++++++++-
2 files changed, 40 insertions(+), 2 deletions(-)



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

* pgsql: Fix inadequate buffer locking in FSM and VM page re-initializati
@ 2018-07-13 15:53  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2018-07-13 15:53 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix inadequate buffer locking in FSM and VM page re-initialization.

When reading an existing FSM or VM page that was found to be corrupt by the
buffer manager, the code applied PageInit() to reinitialize the page, but
did so without any locking.  There is thus a hazard that two backends might
concurrently do PageInit, which in itself would still be OK, but the slower
one might then zero over subsequent data changes applied by the faster one.
Even that is unlikely to be fatal; but it's not desirable, so add locking
to prevent it.

This does not add any locking overhead in the normal code path where the
page is OK.  It's not immediately obvious that that's safe, but I believe
it is, for reasons explained in the added comments.

Problem noted by R P Asim.  It's been like this for a long time, so
back-patch to all supported branches.

Discussion: https://postgr.es/m/CANXE4Te4G0TGq6cr0-TvwP0H4BNiK_-hB5gHe8mF+nz0mcYfMQ@mail.gmail.com

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/17c3dabbb70c4d2ecbecfb9b33db11a5da3a7f5a

Modified Files
--------------
src/backend/access/heap/visibilitymap.c   | 21 ++++++++++++++++++++-
src/backend/storage/freespace/freespace.c | 21 ++++++++++++++++++++-
2 files changed, 40 insertions(+), 2 deletions(-)



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

* pgsql: Fix inadequate buffer locking in FSM and VM page re-initializati
@ 2018-07-13 15:53  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2018-07-13 15:53 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix inadequate buffer locking in FSM and VM page re-initialization.

When reading an existing FSM or VM page that was found to be corrupt by the
buffer manager, the code applied PageInit() to reinitialize the page, but
did so without any locking.  There is thus a hazard that two backends might
concurrently do PageInit, which in itself would still be OK, but the slower
one might then zero over subsequent data changes applied by the faster one.
Even that is unlikely to be fatal; but it's not desirable, so add locking
to prevent it.

This does not add any locking overhead in the normal code path where the
page is OK.  It's not immediately obvious that that's safe, but I believe
it is, for reasons explained in the added comments.

Problem noted by R P Asim.  It's been like this for a long time, so
back-patch to all supported branches.

Discussion: https://postgr.es/m/CANXE4Te4G0TGq6cr0-TvwP0H4BNiK_-hB5gHe8mF+nz0mcYfMQ@mail.gmail.com

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/073ffefd80828dd16d6ad692b2d91501284ab7e2

Modified Files
--------------
src/backend/access/heap/visibilitymap.c   | 21 ++++++++++++++++++++-
src/backend/storage/freespace/freespace.c | 21 ++++++++++++++++++++-
2 files changed, 40 insertions(+), 2 deletions(-)



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

* pgsql: Fix inadequate buffer locking in FSM and VM page re-initializati
@ 2018-07-13 15:53  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2018-07-13 15:53 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix inadequate buffer locking in FSM and VM page re-initialization.

When reading an existing FSM or VM page that was found to be corrupt by the
buffer manager, the code applied PageInit() to reinitialize the page, but
did so without any locking.  There is thus a hazard that two backends might
concurrently do PageInit, which in itself would still be OK, but the slower
one might then zero over subsequent data changes applied by the faster one.
Even that is unlikely to be fatal; but it's not desirable, so add locking
to prevent it.

This does not add any locking overhead in the normal code path where the
page is OK.  It's not immediately obvious that that's safe, but I believe
it is, for reasons explained in the added comments.

Problem noted by R P Asim.  It's been like this for a long time, so
back-patch to all supported branches.

Discussion: https://postgr.es/m/CANXE4Te4G0TGq6cr0-TvwP0H4BNiK_-hB5gHe8mF+nz0mcYfMQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/130beba36d6dd46b8c527646f9f2433347cbfb11

Modified Files
--------------
src/backend/access/heap/visibilitymap.c   | 21 ++++++++++++++++++++-
src/backend/storage/freespace/freespace.c | 21 ++++++++++++++++++++-
2 files changed, 40 insertions(+), 2 deletions(-)



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


end of thread, other threads:[~2018-07-13 15:53 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-07-13 15:53 pgsql: Fix inadequate buffer locking in FSM and VM page re-initializati Tom Lane <tgl@sss.pgh.pa.us>
2018-07-13 15:53 pgsql: Fix inadequate buffer locking in FSM and VM page re-initializati Tom Lane <tgl@sss.pgh.pa.us>
2018-07-13 15:53 pgsql: Fix inadequate buffer locking in FSM and VM page re-initializati Tom Lane <tgl@sss.pgh.pa.us>
2018-07-13 15:53 pgsql: Fix inadequate buffer locking in FSM and VM page re-initializati Tom Lane <tgl@sss.pgh.pa.us>
2018-07-13 15:53 pgsql: Fix inadequate buffer locking in FSM and VM page re-initializati Tom Lane <tgl@sss.pgh.pa.us>
2018-07-13 15:53 pgsql: Fix inadequate buffer locking in FSM and VM page re-initializati Tom Lane <tgl@sss.pgh.pa.us>
2018-07-13 15:53 pgsql: Fix inadequate buffer locking in FSM and VM page re-initializati Tom Lane <tgl@sss.pgh.pa.us>

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