Re: Checkpoint not retrying failed fsync?

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: Checkpoint not retrying failed fsync?
Дата
Msg-id CAEepm=1QZVZjrEEFfYAMkfhL+1FjiG7-ufQcBfOHSFqP95aOdg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Checkpoint not retrying failed fsync?  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Ответы Re: Checkpoint not retrying failed fsync?  (Thomas Munro <thomas.munro@enterprisedb.com>)
Список pgsql-hackers
On Fri, Apr 6, 2018 at 11:34 AM, Andrew Gierth
<andrew@tao11.riddles.org.uk> wrote:
>>>>>> "Thomas" == Thomas Munro <thomas.munro@enterprisedb.com> writes:
>
>  >> As far as I can tell from reading the code, if a checkpoint fails the
>  >> checkpointer is supposed to keep all the outstanding fsync requests for
>  >> next time. Am I wrong, or is there some failure in the logic to do this?
>
>  Thomas> Yikes.  I think this is suspicious:
>
> Yes, tracing through a checkpoint shows that this is clearly wrong.
>
>  Thomas> Why is it OK to unlink the bitmapset? We still need its
>  Thomas> contents, in the case that the fsync fails!
>
> Right.
>
> But I don't think just copying the value is sufficient; if a new bit was
> set while we were processing the old ones, how would we know which to
> clear? We couldn't just clear all the bits afterwards because then we
> might lose a request.

Agreed.  The attached draft patch handles that correctly, I think.

-- 
Thomas Munro
http://www.enterprisedb.com

Вложения

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

Предыдущее
От: Andrew Gierth
Дата:
Сообщение: Re: Checkpoint not retrying failed fsync?
Следующее
От: Andrew Gierth
Дата:
Сообщение: Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS