Re: O_DIRECT for WAL writes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: O_DIRECT for WAL writes
Дата
Msg-id 13664.1117466694@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: O_DIRECT for WAL writes  (Neil Conway <neilc@samurai.com>)
Ответы Re: O_DIRECT for WAL writes
Список pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> On Mon, 2005-05-30 at 02:52 -0400, Tom Lane wrote:
> Well, that claims that "data is guaranteed to have been transferred",
> but transferred to *where* is the question :)

Oh, I see what you are worried about.  I think you are right: what the
doc promises is only that the DMA transfer has finished (ie, it's safe
to scribble on your buffer again).  So you'd still need an fsync;
which makes O_DIRECT orthogonal to wal_sync_method rather than a
valid choice for it.  (Hm, I wonder if specifying both O_DIRECT and
O_SYNC works ...)

> The other question is whether these semantics are identical among the
> various O_DIRECT implementations (e.g. Linux, FreeBSD, AIX, IRIX, and
> others).

Wouldn't count on it :-(.  One thing I'm particularly worried about is
buffer cache consistency: does the kernel guarantee to flush any buffers
it has that overlap the O_DIRECT write operation?  Without this, an
application reading the WAL using normal non-O_DIRECT I/O might see the
wrong data; which is bad news for PITR.

            regards, tom lane

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] patches for items from TODO list
Следующее
От: Bruce Momjian
Дата:
Сообщение: Support only octal for psql PROMPT % values