Re: What does "[backends] should seldom or never need to wait for a write to occur" mean?

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: What does "[backends] should seldom or never need to wait for a write to occur" mean?
Дата
Msg-id CA+hUKGJG-4huRapjPL7kBXAd+iBW5i09WKgWOFF6E31z_aHkmQ@mail.gmail.com
обсуждение исходный текст
Ответ на What does "[backends] should seldom or never need to wait for a write to occur" mean?  (PG Doc comments form <noreply@postgresql.org>)
Ответы Re: What does "[backends] should seldom or never need to wait for a write to occur" mean?
Список pgsql-docs
On Fri, Oct 30, 2020 at 11:24 AM PG Doc comments form
<noreply@postgresql.org> wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/13/runtime-config-resource.html
> Description:
>
> https://www.postgresql.org/docs/13/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-BACKGROUND-WRITER
>
> says:
>
> "There is a separate server process called the background writer, whose
> function is to issue writes of “dirty” (new or modified) shared buffers. It
> writes shared buffers so server processes handling user queries seldom or
> never need to wait for a write to occur."
>
> It's not clear what "wait for a write to occur" means: a write() syscall or
> an fsync() syscall?

It means pwrite().  That could block if your kernel cache is swamped,
but hopefully it just copies the data into the kernel and returns.
There is an fsync() call, but it's usually queued up for handling by
the checkpointer process some time later.



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 127.0.0.1 or localhost
Следующее
От: Chris Wilson
Дата:
Сообщение: Re: What does "[backends] should seldom or never need to wait for a write to occur" mean?