Re: Unlogged relation copy is not fsync'd

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Unlogged relation copy is not fsync'd
Дата
Msg-id ZPlTTsQRMTdYYxHg@paquier.xyz
обсуждение исходный текст
Ответ на Re: Unlogged relation copy is not fsync'd  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Tue, Sep 05, 2023 at 02:20:18PM -0400, Robert Haas wrote:
> The general rule throughout the system is that the init-fork of an
> unlogged relation is treated the same as a permanent relation: it is
> WAL-logged and fsyncd. But the other forks of an unlogged relation are
> neither WAL-logged nor fsync'd ... except in the case of a clean
> shutdown, when we fsync even that data.
>
> In other words, somehow it feels like we ought to be trying to defer
> the fsync here until a clean shutdown actually occurs, instead of
> performing it immediately. Admittedly, the bookkeeping seems like a
> problem, so maybe this is the best we can do, but it's clearly worse
> than what we do in other cases.

That's where we usually rely more on RegisterSyncRequest() and
register_dirty_segment() so as the flush of the dirty segments can
happen when they should, but we don't go through the shared buffers
when copying all the forks of a relation file across tablespaces..
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: pg_basebackup: Always return valid temporary slot names
Следующее
От: vignesh C
Дата:
Сообщение: Re: persist logical slots to disk during shutdown checkpoint