Re: write ahead logging in standby (streaming replication)

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема Re: write ahead logging in standby (streaming replication)
Дата
Msg-id 3f0b79eb0911112031w6bf54d80r89957de9f90c6487@mail.gmail.com
обсуждение исходный текст
Ответ на Re: write ahead logging in standby (streaming replication)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: write ahead logging in standby (streaming replication)
Re: write ahead logging in standby (streaming replication)
Список pgsql-hackers
On Thu, Nov 12, 2009 at 12:03 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Fujii Masao <masao.fujii@gmail.com> writes:
>> Should the standby also have to follow the WAL rule during recovery?
>> The current patch doesn't care about the write order of the data page
>> and WAL in the standby. So, after both servers fail, restarting the
>> ex-standby by itself might corrupt the data.
>
> Surely the receiver should fsync the WAL itself to disk before
> acknowledging it.  Assuming you've done that, I don't see any
> corruption risk.

"acknowledging it" means "letting the startup process know the arrival
of WAL records"? If so, I agree that there is no risk of data corruption.

The problem is that fsync needs to be issued too frequently, which would
be harmless in asynchronous replication, but not in synchronous one.
A transaction would have to wait for the primary's and standby's fsync
before returning a "success" to a client.

So I'm inclined to change the startup process and bgwriter, instead of
walreceiver, so as to fsync the WAL for the WAL rule.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


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

Предыдущее
От: Andrew Chernow
Дата:
Сообщение: Re: Listen / Notify rewrite
Следующее
От: "A.M."
Дата:
Сообщение: Re: Listen / Notify rewrite