Skip site navigation (1) Skip section navigation (2)

Re: fsyncing data to disk

From: Greg Stark <stark(at)mit(dot)edu>
To: Florian Pflug <fgp(at)phlo(dot)org>
Cc: Nulik Nol <nuliknol(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: fsyncing data to disk
Date: 2011-09-09 23:35:20
Message-ID: CAM-w4HPQUZuUwZXfqAL+2b9UEjUJ3_XU1tjizTuXFVQEoetopw@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Fri, Sep 9, 2011 at 7:46 PM, Florian Pflug <fgp(at)phlo(dot)org> wrote:
>> I am going to use the whole partition device for the DB (like /dev/sda1)
>> , so no filesystem code will be used. Also I am using asynchronous IO
>> (the aio_read and aio_write) and I don't know if they can be combined
>> with the fdatasync() syscall?
>
> Someone else (maybe the POSIX spec?) must answer that as I know very little
> about asynchronous IO.
>

There's an aio_fsync as part of the aio api, But you could use fsync
or fdatasync -- I assume you would have to wait for the aio_write to
have finished before you issue the fsync. But if you're going to
fdatasync all your writes right away you may as well open with O_DSYNC
which is, I gather, exactly how aio is intended to be used.

-- 
greg

In response to

pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2011-09-10 01:31:53
Subject: nonempty default log_line_prefix (was [COMMITTERS] pgsql: Simplify handling of the timezone GUC)
Previous:From: Greg StarkDate: 2011-09-09 23:07:28
Subject: Re: unite recovery.conf and postgresql.conf

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group