pgsql: Avoid tricky race condition recording XLOG_HINT

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема pgsql: Avoid tricky race condition recording XLOG_HINT
Дата
Msg-id E1UP6x9-0005JB-N0@gemulon.postgresql.org
обсуждение исходный текст
Ответы Re: pgsql: Avoid tricky race condition recording XLOG_HINT  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: pgsql: README comments on checksums on page holes.
Следующее
От: Thom Brown
Дата:
Сообщение: Re: pgsql: README comments on checksums on page holes.