Re: fsync and hardware write cache

From: Manfred Spraul <manfred(at)colorfullife(dot)com>
To: pgsql(at)mohawksoft(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: fsync and hardware write cache
Date: 2004-08-23 20:19:20
Message-ID: 412A5148.10408@colorfullife.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

pgsql(at)mohawksoft(dot)com wrote:

>Something to think about:
>
>if you run PostgreSQL with fsync on, but you use the hardware write cache
>on your disk drives, how likely are you to lose data? Obviously, this is a
>fairly limited problem, as it only applies to power down (which you can
>control) or power loss where the risks may be reduced but not eliminated
>with a UPS.
>
>Does it make sense to add a platform specific call that will flush a write
>cache when fsync is enable?
>
>
>
Pete Zaitsev from mysql wrote that there is a special call on Mac OS:
Quoting him:

>Mac OS X also has this "optimization", but at least it provides an
>alternative flush method for Database Servers:
>
>fcntl(fd, F_FULLFSYNC, NULL)
>
>can be used instead of fsync() to get true fsync() behavior.
>

I couldn't confirm this with a quick google search - perhaps someone
with MacOS docs (or mysql sources) should check it.

What might be useful is a test tool that benchmarks fsync: if it's
faster than the rotational speed of a 15k rpm disk then probably someone
caches the write calls.

--
Manfred

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2004-08-23 21:03:26 PITR: XLog File compression on Archive
Previous Message Daniel Kalchev 2004-08-23 20:02:49 Re: missing data/global