Re: WAL and commit_delay

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: WAL and commit_delay
Дата
Msg-id 4356.982435582@sss.pgh.pa.us
обсуждение исходный текст
Ответ на WAL and commit_delay  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: WAL and commit_delay  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: WAL and commit_delay  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: WAL and commit_delay  ("Dominic J. Eidson" <sauron@the-infinite.org>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> With the delay, it looks like:

> time    backend 1    backend 2
> ----    ---------    ---------
> 0    write()        
> 1    sleep()        write()
> 2    fsync()        sleep()
> 3            fsync()

Actually ... take a close look at the code.  The delay is done in
xact.c between XLogInsert(commitrecord) and XLogFlush().  As near
as I can tell, both the write() and the fsync() will happen in
XLogFlush().  This means the delay is just plain broken: placed
there, it cannot do anything except waste time.

Another thing I am wondering about is why we're not using fdatasync(),
where available, instead of fsync().  The whole point of preallocating
the WAL files is to make fdatasync safe, no?
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Microsecond sleeps with select()
Следующее
От: Tom Lane
Дата:
Сообщение: Re: WAL and commit_delay