X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C76C8D1B49E; Fri, 30 Jan 2004 17:01:38 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 12114-05; Fri, 30 Jan 2004 13:01:38 -0400 (AST) Received: from candle.pha.pa.us (candle.pha.pa.us [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id F36AFD1B4BD; Fri, 30 Jan 2004 13:01:36 -0400 (AST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id i0UH1bZ08600; Fri, 30 Jan 2004 12:01:37 -0500 (EST) From: Bruce Momjian Message-Id: <200401301701.i0UH1bZ08600@candle.pha.pa.us> Subject: Sync vs. fsync during checkpoint To: PostgreSQL-development , PostgreSQL Win32 port list Date: Fri, 30 Jan 2004 12:01:37 -0500 (EST) X-Mailer: ELM [version 2.4ME+ PL108 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/790 X-Sequence-Number: 49514 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