Re: sync()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: sync()
Дата
Msg-id 1771.1042009366@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: sync()  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Ответы Re: sync()  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Re: sync()  (Kevin Brown <kevin@sysexperts.com>)
Список pgsql-hackers
Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> I'm just wondering why we do not use fsync() to flush data/index
> pages.

There isn't any efficient way to do that AFAICS.  The process that wants
to do the checkpoint hasn't got any way to know just which files need to
be sync'd.  Even if it did know, it's not clear to me that we can
portably assume that process A issuing an fsync on a file descriptor F
it's opened for file X will force to disk previous writes issued against
the same physical file X by a different process B using a different file
descriptor G.

sync() is surely overkill, in that it writes out dirty kernel buffers
that might have nothing at all to do with Postgres.  But I don't see how
to do better.
        regards, tom lane


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

Предыдущее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: psql and readline
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: sync()