Re: Buffer Management

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Buffer Management
Дата
Msg-id 7703.1025016772@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Buffer Management  ("Mario Weilguni" <mario.weilguni@icomedias.com>)
Ответы Re: Buffer Management
Список pgsql-hackers
"Mario Weilguni" <mario.weilguni@icomedias.com> writes:
> Isn't that what msync() is for? Or is this not portable?

msync can force not-yet-written changes down to disk.  It does not
prevent the OS from choosing to write changes *before* you invoke msync.
For example, the HPUX man page for msync says:
    Normal system activity can cause pages to be written to disk.    Therefore, there are no guarantees that msync() is
theonly control    over when pages are or are not written to disk.
 

Our problem is that we want to enforce the write ordering "WAL before
data file".  To do that, we write and fsync (or DSYNC, or something)
a WAL entry before we issue the write() against the data file.  We
don't really care if the kernel delays the data file write beyond that
point, but we can be certain that the data file write did not occur
too early.

msync is designed to ensure exactly the opposite constraint: it can
guarantee that no changes remain unwritten after time T, but it can't
guarantee that changes aren't written before time T.
        regards, tom lane




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

Предыдущее
От: "Mario Weilguni"
Дата:
Сообщение: Re: Buffer Management
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Buffer Management