Re: Allowing WAL fsync to be done via O_SYNC - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Allowing WAL fsync to be done via O_SYNC
Date
Msg-id 23719.984722094@sss.pgh.pa.us
Whole thread Raw
In response to Re: Allowing WAL fsync to be done via O_SYNC  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Allowing WAL fsync to be done via O_SYNC  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> It is hard for me to imagine O_* being slower than fsync(),

Not hard at all --- if we're writing multiple xlog blocks per
transaction, then O_* constrains the sequence of operations more
than we really want.  Changing xlog.c to combine writes as much
as possible would reduce this problem, but not eliminate it.

Besides, the entire object of this exercise is to work around
an unexpected inefficiency in some kernels' implementations of
fsync/fdatasync (viz, scanning over lots of not-dirty buffers).
Who's to say that there might not be inefficiencies in other
platforms' implementations of the O_* options?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Allowing WAL fsync to be done via O_SYNC
Next
From: Xu Yifeng
Date:
Subject: Re[2]: Allowing WAL fsync to be done via O_SYNC