Re: Win32 Powerfail testing - Mailing list pgsql-hackers

From Kevin Brown
Subject Re: Win32 Powerfail testing
Date
Msg-id 20030307100541.GX1833@filer
Whole thread Raw
In response to Re: Win32 Powerfail testing  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Responses Re: Win32 Powerfail testing  (Hannu Krosing <hannu@tm.ee>)
Re: Win32 Powerfail testing  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Tatsuo Ishii wrote:
> Today I revisited the implemnetation (replacing sync() with
> open/_commit) I made several days ago and found a bug with it (thanks
> to Hiroshi). With the fixed version of it, now my Win32 port has
> passed your test even right after checkpoint!.

I presume that this implementation tracks which files have been opened
and uses _commit() to write all the changes to disk for those files?

If so, then it would be of significant value, IMHO, if you could
abstract the changes in such a way that they could be applied to the
Unix side as well.

sync() writes *all* uncommitted buffers to disk, whether or not they
belong to the process or process group that initiated the sync().  On
systems which do more than just host PG, a sync() does more work
(sometimes much more work) than is necessary and will unnecessarily
burden the system with writes.  I think it would be a win, from a
design standpoint if nothing else, if PG committed only those pages
that it was responsible for.

The Unix equivalent of _commit() appears to be fsync() or fdatasync().
So it sounds a lot like a "port" to Unix of the changes you have made
for this might easily be a trivial search and replace.  :-)

-- 
Kevin Brown                          kevin@sysexperts.com


pgsql-hackers by date:

Previous
From: "Dave Page"
Date:
Subject: Re: Win32 Powerfail testing
Next
From: Hannu Krosing
Date:
Subject: Re: Win32 Powerfail testing