Re: crash recovery vs partially written WAL

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: crash recovery vs partially written WAL
Дата
Msg-id 20201231192744.GN27507@tamriel.snowman.net
обсуждение исходный текст
Ответ на Re: crash recovery vs partially written WAL  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: crash recovery vs partially written WAL  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
Greetings,

* Bruce Momjian (bruce@momjian.us) wrote:
> On Wed, Dec 30, 2020 at 12:52:46PM -0800, Andres Freund wrote:
> > A question from a colleague made me wonder if there are scenarios where
> > two subsequent crashes could lead to wrong WAL to be applied.
> >
> > Imagine the following scenario
> > [ xlog page 1 ][ xlog page 2 ][ xlog page 3 ][ xlog page 4 ]
> >     ^flush                                        ^write ^insert
> >
> > if the machine crashes in this moment, we could end up with a situation
> > where page 1, 3, 4 made it out out to disk, but page 2 wasn't.
>
> I don't see any flaw in your logic.  Seems we have to zero out all
> future WAL files, not just to the end of the current one, or at least
> clear xlp_pageaddr on each future page.

I've wondered before if we should be doing a timeline switch at the end
of crash recovery...

Thanks,

Stephen

Вложения

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: [HACKERS] [PATCH] Generic type subscripting
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: new heapcheck contrib module