Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, PostgreSQL Win32 port list <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint
Date: 2004-01-30 17:21:54
Message-ID: 200401301721.i0UHLsi12233@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > The trick is to somehow record all files modified since the last
> > checkpoint, and open/fsync/close each one. My idea is to stat() each
> > file in each directory and compare the modify time to determine if the
> > file has been modified since the last checkpoint.
>
> This seems a complete non-starter, as stat() generally has at best
> one-second resolution on mod times, even if you assume that the kernel
> keeps mod time fully up-to-date at all times. In any case, it's
> difficult to believe that stat'ing everything in a database directory
> will be faster than keeping track of it for ourselves.

Yes, we would have to have a slop factor and fsync anything more than
one second before the last checkpoint. Any ideas on how to record the
modified files without generating tones of output or locking contention?

--
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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-01-30 17:25:05 Re: Mixing threaded and non-threaded
Previous Message Steve Atkins 2004-01-30 17:14:06 Re: Mixing threaded and non-threaded

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Tom Lane 2004-01-30 17:51:16 Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint
Previous Message Tom Lane 2004-01-30 17:13:55 Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint