Re: GiST index build missing smgrimmedsync()?

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: GiST index build missing smgrimmedsync()?
Дата
Msg-id fe061c6b-af54-5ca6-6c05-6ec0521ba607@iki.fi
обсуждение исходный текст
Ответ на GiST index build missing smgrimmedsync()?  (Melanie Plageman <melanieplageman@gmail.com>)
Список pgsql-hackers
On 23/02/2022 23:30, Melanie Plageman wrote:
> I brought this up in [1] but wanted to start a dedicated thread.
> 
> Since 16fa9b2b30a357 GiST indexes are not built in shared buffers.
> However, smgrimmedsync() is not done anywhere and skipFsync=true is
> always passed to smgrwrite() and smgrextend(). So, if a checkpoint
> starts and finishes after WAL-logging some of the index build pages and
> there is a crash sometime before the dirty pages make it to permanent
> storage, won't that data be lost?

Yes, good catch!

> Seems like the following would address this:

Committed essentially that, except that I put the smgrimmedsync in a 
separate if-block, and copied the comment from the similar piece of code 
from nbtsort.c to explain the issue.

Thanks!

- Heikki



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

Предыдущее
От: Dagfinn Ilmari Mannsåker
Дата:
Сообщение: Re: Add id's to various elements in protocol.sgml
Следующее
От: Andres Freund
Дата:
Сообщение: Re: convert libpq uri-regress tests to tap test