Is full_page_writes=off safe in conjunction with PITR?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Is full_page_writes=off safe in conjunction with PITR?
Дата
Msg-id 25686.1145047213@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: Is full_page_writes=off safe in conjunction with  (Hannu Krosing <hannu@skype.net>)
Re: Is full_page_writes=off safe in conjunction with PITR?  (markir@paradise.net.nz)
Re: Is full_page_writes=off safe in conjunction with PITR?  (Florian Weimer <fw@deneb.enyo.de>)
Список pgsql-hackers
While thinking about the patch I just made to allow full_page_writes to
be turned off again, it struck me that this patch only fixes the problem
for post-crash XLOG replay.  There is still a hazard if the variable is
turned off in a PITR master system.  The reason is that while a base
backup is being taken, the backup-taker might read an inconsistent state
of a page and include that in the backup.  This is not a problem if
full_page_writes is ON --- it's logically equivalent to a torn page
write and will be fixed on the slave by XLOG replay.  But it *is* a
problem if full_page_writes is OFF, for exactly the same reason that
torn page writes are a problem.

I think we had originally argued that there was no problem anyway
because the kernel should cause the page write to appear atomic to other
processes (since we issue it in a single write() command).  But that's
only true if the backup-taker reads in units that are multiples of
BLCKSZ.  If the backup-taker reads, say, 4K at a time then it's
certainly possible that it gets a later version of the second half of a
page than it got of the first half.  I don't know about you, but I sure
don't feel comfortable making assumptions at that level about the
behavior of tar or cpio.

I fear we still have to disable full_page_writes (force it ON) if
XLogArchivingActive is on.  Comments?
        regards, tom lane


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

Предыдущее
От: Mark Dilger
Дата:
Сообщение: Re: two-argument aggregates and SQL 2003
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Practical impediment to supporting multiple SSL libraries