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 1DA43D1DAA0 for ; Sun, 15 Feb 2004 16:27:06 +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 22360-02 for ; Sun, 15 Feb 2004 12:27:03 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id C7BDBD1DA97 for ; Sun, 15 Feb 2004 12:27:02 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i1FGQrAL008527; Sun, 15 Feb 2004 11:26:54 -0500 (EST) To: Florian Weimer Cc: shridhar@frodo.hserus.net, PostgreSQL-development Subject: Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint In-reply-to: <20040215130516.GA5939@deneb.enyo.de> References: <46C15C39FEB2C44BA555E356FBCD6FA49620A3@m0114.s-mxs.net> <2297.1075992889@sss.pgh.pa.us> <200402052045.48448.shridhar@frodo.hserus.net> <3593.1075998120@sss.pgh.pa.us> <20040215130516.GA5939@deneb.enyo.de> Comments: In-reply-to Florian Weimer message dated "Sun, 15 Feb 2004 14:05:16 +0100" Date: Sun, 15 Feb 2004 11:26:53 -0500 Message-ID: <8526.1076862413@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/565 X-Sequence-Number: 50154 Florian Weimer writes: > Tom Lane wrote: >> You can only fsync one FD at a time (too bad ... if there were a >> multi-file-fsync API it'd solve the overspecified-write-ordering issue). > What about aio_fsync()? (1) it's unportable; (2) it's not clear that it's any improvement over fsync(). The Single Unix Spec says aio_fsync "returns when the synchronisation request has been initiated or queued to the file or device". Depending on how the implementation works, this may mean that all the dirty blocks have been scheduled for I/O and will be written ahead of subsequently scheduled blocks --- if so, the results are not really different from fsync()'ing the files in the same order. The best idea I've heard so far is the one about sync() followed by a bunch of fsync()s. That seems to be correct, efficient, and dependent only on very-long-established Unix semantics. regards, tom lane