Re: Refactoring the checkpointer's fsync request queue

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Refactoring the checkpointer's fsync request queue
Дата
Msg-id 20181113180705.2yrcpxuo5ucqp3b6@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: Refactoring the checkpointer's fsync request queue  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Refactoring the checkpointer's fsync request queue  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Hi,

On 2018-11-13 12:04:23 -0500, Robert Haas wrote:
> I still feel like this whole pass-the-fds-to-the-checkpointer thing is
> a bit of a fool's errand, though.  I mean, there's no guarantee that
> the first FD that gets passed to the checkpointer is the first one
> opened, or even the first one written, is there?

I'm not sure I understand the danger you're seeing here. It doesn't have
to be the first fd opened, it has to be an fd that's older than all the
writes that we need to ensure made it to disk. And that ought to be
guaranteed by the logic?  Between the FileWrite() and the
register_dirty_segment() (and other relevant paths) the FD cannot be
closed.


> It seems like if you wanted to make this work reliably, you'd need to
> do it the other way around: have the checkpointer (or some other
> background process) open all the FDs, and anybody else who wants to
> have one open get it from the checkpointer.

That'd require a process context switch for each FD opened, which seems
clearly like a no-go?

Greetings,

Andres Freund


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Refactoring the checkpointer's fsync request queue
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Race condition in WaitForBackgroundWorkerStartup