pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix data-corruption hazard in WAL-logged CREATE DATABASE.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix data-corruption hazard in WAL-logged CREATE DATABASE.
@ 2022-08-06 15:50  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2022-08-06 15:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix data-corruption hazard in WAL-logged CREATE DATABASE.

RelationCopyStorageUsingBuffer thought it could skip copying
empty pages, but of course that does not work at all, because
subsequent blocks will be out of place.

Also fix it to acquire share lock on the source buffer.  It *might*
be safe to not do that, but it's not very certain, and I don't think
this code deserves any benefit of the doubt.

Dilip Kumar, per complaint from me

Discussion: https://postgr.es/m/3679800.1659654066@sss.pgh.pa.us

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/811203d4aff505c414e4a9e8c57ea6bb3edfe92e

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)



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

* pgsql: Fix data-corruption hazard in WAL-logged CREATE DATABASE.
@ 2022-08-06 15:50  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2022-08-06 15:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix data-corruption hazard in WAL-logged CREATE DATABASE.

RelationCopyStorageUsingBuffer thought it could skip copying
empty pages, but of course that does not work at all, because
subsequent blocks will be out of place.

Also fix it to acquire share lock on the source buffer.  It *might*
be safe to not do that, but it's not very certain, and I don't think
this code deserves any benefit of the doubt.

Dilip Kumar, per complaint from me

Discussion: https://postgr.es/m/3679800.1659654066@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/692df425b6883dd3edcc15bb984415ef349fafb1

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)



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


end of thread, other threads:[~2022-08-06 15:50 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-08-06 15:50 pgsql: Fix data-corruption hazard in WAL-logged CREATE DATABASE. Tom Lane <tgl@sss.pgh.pa.us>
2022-08-06 15:50 pgsql: Fix data-corruption hazard in WAL-logged CREATE DATABASE. 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