SRA Win32 sync() code
Bruce Momjian <pgman@candle.pha.pa.us>
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: PostgreSQL-patches <pgsql-patches@postgresql.org>, PostgreSQL Win32 port list <pgsql-hackers-win32@postgresql.org>
Date: 2003-11-16T05:00:56Z
Lists: pgsql-hackers
Attachments
- (unnamed) (text/plain)
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@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073