pgsql: Avoid tricky race condition recording XLOG_HINT - Mailing list pgsql-committers

From Simon Riggs
Subject pgsql: Avoid tricky race condition recording XLOG_HINT
Date
Msg-id E1UP6x9-0005JB-N0@gemulon.postgresql.org
Whole thread Raw
Responses Re: pgsql: Avoid tricky race condition recording XLOG_HINT  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
Avoid tricky race condition recording XLOG_HINT
We copy the buffer before inserting an XLOG_HINT to avoid WAL CRC errors
caused by concurrent hint writes to buffer while share locked. To make this work
we refactor RestoreBackupBlock() to allow an XLOG_HINT to avoid the normal
path for backup blocks, which assumes the underlying buffer is exclusive locked.
Resulting code completely changes layout of XLOG_HINT WAL records, but
this isn't even beta code, so this is a low impact change.
In passing, avoid taking WALInsertLock for full page writes on checksummed
hints, remove related cruft from XLogInsert() and improve xlog_desc record for
XLOG_HINT.

Andres Freund

Bug report by Fujii Masao, testing by Jeff Janes and Jaime Casanova,
review by Jeff Davis and Simon Riggs. Applied with changes from review
and some comment editing.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/47c4333189c9eb5ac1f95adc90213e61996f53c4

Modified Files
--------------
src/backend/access/rmgrdesc/xlogdesc.c |    6 +-
src/backend/access/transam/xlog.c      |  232 +++++++++++++++++++-------------
src/backend/storage/buffer/bufmgr.c    |    4 +-
src/include/catalog/catversion.h       |    2 +-
4 files changed, 144 insertions(+), 100 deletions(-)


pgsql-committers by date:

Previous
From: Simon Riggs
Date:
Subject: pgsql: README comments on checksums on page holes.
Next
From: Thom Brown
Date:
Subject: Re: pgsql: README comments on checksums on page holes.