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 6FD04D1B4B7 for ; Mon, 2 Feb 2004 22:46:14 +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 33420-04 for ; Mon, 2 Feb 2004 18:46:12 -0400 (AST) Received: from smtp.istop.com (dci.doncaster.on.ca [66.11.168.194]) by svr1.postgresql.org (Postfix) with ESMTP id 5BA5CD1B4C0 for ; Mon, 2 Feb 2004 18:46:06 -0400 (AST) Received: from stark.xeocode.com (gsstark.mtl.istop.com [66.11.160.162]) by smtp.istop.com (Postfix) with ESMTP id 89EFB17C4B6; Mon, 2 Feb 2004 17:43:07 -0500 (EST) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1AnmmZ-0002xd-00; Mon, 02 Feb 2004 17:43:07 -0500 To: pgsql-hackers@postgresql.org Subject: Re: Sync vs. fsync during checkpoint References: <200401301701.i0UH1bZ08600@candle.pha.pa.us> In-Reply-To: <200401301701.i0UH1bZ08600@candle.pha.pa.us> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 02 Feb 2004 17:43:07 -0500 Message-ID: <87ptcxumpw.fsf@stark.xeocode.com> Lines: 21 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/61 X-Sequence-Number: 49650 Bruce Momjian writes: > 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. Note that some people believe that if you do this it doesn't guarantee that any data written to other file descriptors referring to the same files would also get synced. I am not one of those people however. Both Solaris and NetBSD kernel hackers have told me those OS's would work in such a scheme and furthermore that they cannot imagine any sane VFS that would fail. I definitely think it's better than calling sync(2) which doesn't guarantee the blocks are written by any particular time at all.. -- greg