X-Original-To: pgsql-hackers-win32-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 7C34DD1DD21 for ; Mon, 9 Feb 2004 16:27:04 +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 02131-09 for ; Mon, 9 Feb 2004 12:26:53 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id C6E9ED1DAB9 for ; Mon, 9 Feb 2004 12:26:52 -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 i19GQhNm020322; Mon, 9 Feb 2004 11:26:44 -0500 (EST) To: Jan Wieck Cc: Bruce Momjian , Zeugswetter Andreas SB SD , PostgreSQL-development , PostgreSQL Win32 port list Subject: Re: [HACKERS] Sync vs. fsync during checkpoint In-reply-to: <40279A25.6020600@Yahoo.com> References: <200402080144.i181ija15739@candle.pha.pa.us> <40279A25.6020600@Yahoo.com> Comments: In-reply-to Jan Wieck message dated "Mon, 09 Feb 2004 09:33:09 -0500" Date: Mon, 09 Feb 2004 11:26:43 -0500 Message-ID: <20321.1076344003@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/75 X-Sequence-Number: 615 Jan Wieck writes: > The whole sync() vs. fsync() discussion is in my opinion nonsense at > this point. The sync vs fsync discussion is not about performance, it is about correctness. You can't simply dismiss the fact that we don't know whether a checkpoint is really complete when we write the checkpoint record. I liked the idea put forward by (I think) Kevin Brown, that we issue sync to start the I/O and then a bunch of fsyncs to wait for it to finish. If sync behaves per spec ("all the I/O is scheduled upon return") then the fsyncs will not affect I/O ordering in the least. But they will ensure that we don't proceed until the I/O is all done. Also there is the Windows-port problem of not having sync available. Doing the fsyncs only will provide an adequate, if possibly lower-performing, solution there. regards, tom lane