pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
To: PostgreSQL Win32 port list <pgsql-hackers-win32@postgreSQL.org>
Subject: Sync vs. fsync during checkpoint
Date: Fri, 30 Jan 2004 12:01:37 -0500 (EST)
Message-ID: <200401301701.i0UH1bZ08600@candle.pha.pa.us> (raw)

As some know, win32 doesn't have sync, and some are concerned that sync
isn't reliable enough during checkpoint anyway.

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.  I can't think of an
easier way to efficiently collect all modified files.  In this case, we
let the file system keep track of it for us.

However, on XP, I just tested if files that are kept open have their
modification times modified, and it seems they don't.  If I do:

	while :
		echo test
		sleep 5
	done > x

I see the file size grow every 5 seconds, but I don't see the
modification time change.  Can someone confirm this?

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



view thread (31+ messages)  latest in thread

Message-ID: <200401301701.i0UH1bZ08600@candle.pha.pa.us>
Permalink:  ../200401301701.i0UH1bZ08600@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200401301701.i0UH1bZ08600@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: pgman@candle.pha.pa.us, pgsql-hackers-win32@postgreSQL.org
  Subject: Re: Sync vs. fsync during checkpoint
  In-Reply-To: <200401301701.i0UH1bZ08600@candle.pha.pa.us>
  References: <200401301701.i0UH1bZ08600@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox