Re: archive status ".ready" files may be created too early

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: archive status ".ready" files may be created too early
Дата
Msg-id 20210831202929.3f3jzlzowis4g7gu@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: archive status ".ready" files may be created too early  ("Bossart, Nathan" <bossartn@amazon.com>)
Ответы Re: archive status ".ready" files may be created too early  ("Bossart, Nathan" <bossartn@amazon.com>)
Список pgsql-hackers
Hi,

On 2021-08-31 18:09:36 +0000, Bossart, Nathan wrote:
> On 8/31/21, 10:21 AM, "Andres Freund" <andres@anarazel.de> wrote:
> > What would trigger the flushing? We don't write out partially filled pages
> > unless
> > a) we're explicitly flushing an LSN on the partial page (e.g. because a
> >    synchronous commit record resides on it)
> > b) there's an async commit (i.e. commit with synchronous_commit=off) on the
> >    page
> 
> Ah, so your point is that an open transaction that has written a
> partial page on the next segment wouldn't trigger a flush.

Doesn't have to be a transaction, can be a checkpoint or xl_running_xacts, or
... as well.


> What appears to happen in this case is that bgwriter eventually creates a
> xl_running_xacts record and nudges walwriter to flush it to disk, at which
> point the .ready file(s) will be created.  That's admittedly a bit fragile.

That's not guaranteed to happen. If e.g. the partial record is a checkpoint or
a xl_running_xacts, we'll not trigger further WAL writes in the background,
unless autovacuum ends up doing something.

Regards,

Andres



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

Предыдущее
От: Jacob Champion
Дата:
Сообщение: [PATCH] Support pg_ident mapping for LDAP
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: log_autovacuum in Postgres 14 -- ordering issue