Re: Race condition between hot standby and restoring a FPW

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Race condition between hot standby and restoring a FPW
Дата
Msg-id 3601.1415805633@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Race condition between hot standby and restoring a FPW  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Ответы Re: Race condition between hot standby and restoring a FPW  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Список pgsql-hackers
Heikki Linnakangas <hlinnakangas@vmware.com> writes:
> On 11/12/2014 04:56 PM, Tom Lane wrote:
>> Not great either.  What about an RBM_NOERROR mode that is like RBM_ZERO
>> in terms of handling error conditions, but does not forcibly zero the page
>> if it's already valid?

> Anyway, you don't want to read the page from disk, just to check if it's 
> already valid.

Oh, good point.

> (Note that when the page is already in the buffer-cache, RBM_ZERO 
> already doesn't zero the page. So this race condition only happens when 
> the page isn't in the buffer cache yet).

Right.

On reconsideration I think the "RBM_ZERO returns page already locked"
alternative may be the less ugly.  That has the advantage that any code
that doesn't get updated will fail clearly and reliably.  With the other
thing, you need some additional back channel for the caller to know
whether it must complete the I/O, and it's not obvious what will happen
if it fails to do that (except that it will be bad).
        regards, tom lane



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [REVIEW] Re: Compression of full-page-writes
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Race condition between hot standby and restoring a FPW