pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Florian Weimer <fw@deneb.enyo.de>
Cc: shridhar@frodo.hserus.net, PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint
Date: Sun, 15 Feb 2004 11:26:53 -0500
Message-ID: <8526.1076862413@sss.pgh.pa.us> (raw)
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>

Florian Weimer <fw@deneb.enyo.de> 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



view thread (31+ messages)  latest in thread

Message-ID: <8526.1076862413@sss.pgh.pa.us>
Permalink:  ../8526.1076862413@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8526.1076862413@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, fw@deneb.enyo.de
  Subject: Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint
  In-Reply-To: <8526.1076862413@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox