Skip site navigation (1) Skip section navigation (2)

Sync vs. fsync during checkpoint

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>,PostgreSQL Win32 port list <pgsql-hackers-win32(at)postgreSQL(dot)org>
Subject: Sync vs. fsync during checkpoint
Date: 2004-01-30 17:01:37
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-hackers-win32
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                        |
  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


pgsql-hackers by date

Next:From: Scott LambDate: 2004-01-30 17:10:49
Subject: Re: Mixing threaded and non-threaded
Previous:From: Korea PostgreSQL Users' GroupDate: 2004-01-30 16:25:32
Subject: Re: v7.4.1 text_position() patch

pgsql-hackers-win32 by date

Next:From: Tom LaneDate: 2004-01-30 17:13:55
Subject: Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint
Previous:From: Jason TishlerDate: 2004-01-30 16:47:05
Subject: Re: Additional items for Win32 TODO list?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group