Re: Block-level CRC checks

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Block-level CRC checks
Дата
Msg-id 20081113192540.GE4062@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Block-level CRC checks  (Aidan Van Dyk <aidan@highrise.ca>)
Ответы Re: Block-level CRC checks  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
Aidan Van Dyk wrote:
> 
> I think I'm missing something...
> 
> In this patch, I see you writing WAL records for hint-bits (bufmgr.c
> FlushBuffer).  But doesn't XLogInsert then make a "backup block" record (unless
> it's already got one since last checkpoint)?

I'm not causing a backup block to be written with that WAL record.  The
rationale is that it's not needed -- if there was a critical write to
the page, then there's already a backup block.  If the only write was a
hint bit being set, then the page cannot possibly be torn.

Now that I think about this, I wonder if this can cause problems in some
filesystems.  XFS, for example, zeroes out during recovery any block
that was written to but not fsync'ed before a crash.  This means that if
we change a hint bit after a checkpoing and mark the page dirty, the
system can write the page.  Suppose we crash at this point.  On
recovery, XFS will zero out the block, but there will be nothing with
which to recovery it, because there's no backup block ...

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Block-level CRC checks
Следующее
От: Tom Lane
Дата:
Сообщение: Re: auto_explain contrib moudle