Re: WAL and commit_delay

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, vadim4o(at)email(dot)com
Subject: Re: WAL and commit_delay
Date: 2001-02-17 18:46:22
Message-ID: 4356.982435582@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-02-17 18:55:28 Re: WAL and commit_delay
Previous Message Bruce Momjian 2001-02-17 18:36:00 Re: Microsecond sleeps with select()