SRA Win32 sync() code

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>, PostgreSQL Win32 port list <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: SRA Win32 sync() code
Date: 2003-11-16 05:00:56
Message-ID: 200311160500.hAG50u701539@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32 pgsql-patches

Here is the SRA sync() code for Win32. As you might know, fsync on
Win32 is _commit, and sync() is _flushall. However, _flushall only
flushes only _open_ kernel buffers, not dirty buffers that have been
closed. Therefore, on Win32, during checkpoint, you have to open,
fsync(_commit), close all file that have been modified since the
previous checkpoint.

Not sure how we are going to do this in Win32, but somehow we will have
to record all open files between checkpoints in an area that the
checkpoint process can read during a checkpoint.

Here is the SRA code that records the dirty file and the code that
cycles through the list and fsync's each one.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 2.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2003-11-16 05:27:46 Re: oh dear ...
Previous Message Neil Conway 2003-11-16 02:18:48 Re: source version?

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Tom Lane 2003-11-16 16:32:59 Re: [PATCHES] SRA Win32 sync() code
Previous Message Bruce Momjian 2003-11-15 02:11:14 Re: Win32 pg_ctl

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2003-11-16 10:10:57 Re: improve overcommit docs
Previous Message Bruce Momjian 2003-11-16 04:49:54 Re: minor release note improvements