Re: WAL: O_DIRECT and multipage-writer

Поиск
Список
Период
Сортировка
От ITAGAKI Takahiro
Тема Re: WAL: O_DIRECT and multipage-writer
Дата
Msg-id 20050126203831.8736.ITAGAKI@tiara.ocn.ne.jp
обсуждение исходный текст
Ответ на Re: [PATCHES] WAL: O_DIRECT and multipage-writer  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> What does XLOG_EXTRA_BUFFERS accomplish?

It is because the buffer passed to direct-io must be aligned to 
the same size of filesystem page, typically 4KB. Buffers allocated
with ShmemInitStruct are not necessarily aligned, so we need to allocate
extra buffers and align them by ourself.


> Also, I'm worried that you broke something by not updating
> Write->curridx immediately in XLogWrite.  There certainly isn't going
> to be any measurable performance boost from keeping that in a local
> variable, so why take any risk?

Keeping Write->curridx in a local variable is not for performance,
but for writing multiple pages at once.
I think it is ok to update Write->curridx at the end of XLogWrite,
because XLogCtl.Write.curridx will be touched by only one process
at a time. Process-shared variables are not modified until XLogWrite
is completed, so that other backends can write same contents later
even if the backend in XLogWrite is crushed. 


Sincerely,
ITAGAKI Takahiro



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

Предыдущее
От: Tommi Maekitalo
Дата:
Сообщение: IBM patent
Следующее
От: noman naeem
Дата:
Сообщение: Re: how to add a new column in pg_proc table