From: David G Johnston <david.g.johnston@gmail.com>
To: pgsql-admin@postgresql.org
Subject: Re: Difference between fsync and open_sync
Date: Thu, 17 Apr 2014 20:54:25 -0700 (PDT)
Message-ID: <1397793265476-5800669.post@n5.nabble.com> (raw)
In-Reply-To: <CAOqBXCBetP1Abp7S9GPar6Vp4tBGzLDDeN0hGM2kQXDyVTgadw@mail.gmail.com>
References: <CAOqBXCBetP1Abp7S9GPar6Vp4tBGzLDDeN0hGM2kQXDyVTgadw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
ocalderon wrote
> Hi, have a nice day everybody. I'm reading about WAL and i'm trying to
> understand the theory about it, i mean, all the stuff related to disk
> caches, controller caches and so on, and now in my lectures there is a
> section about the different methods to force WAL updates, wal_sync_method
>
> And googling more i found a very good article (old but useful)
>
> http://www.westnet.com/~gsmith/content/postgresql/TuningPGWAL.htm
>
> And i understood the difference between, for example, fsync and fdatasync,
> and between open_datasync and open_sync, but i cannot understand the
> difference between open_sync and fsync or between open_datasync and
> fdatasync , As far as i could understand, the open_* methods call the
> open() method of linux, and f*sync methods calls the fsync() method of
> linux?
>
> My doubt is about what's the difference between them, or a link where this
> is explained. In the previous link it talks about the 4 methods but i
> cannot distinguish the difference between them.
fsync and open are both system functions for which documentation exists on
the Internet.
Short answer seems to be that the physical write is guaranteed: open =
immediately; fsync = at commit
As long as "fsync mode" is on after a commit command returns the WAL is
promised to be physically written to disk; the means and speed of doing so
vary according to the method chosen (limited by platform), the workload, the
hardware, and the OS.
Others will correct any misunderstandings I may have acquired in my quick
reading and reasoning.
David J.
--
View this message in context: http://postgresql.1045698.n5.nabble.com/Difference-between-fsync-and-open-sync-tp5800666p5800669.htm...
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
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-admin@postgresql.org
Cc: david.g.johnston@gmail.com
Subject: Re: Difference between fsync and open_sync
In-Reply-To: <1397793265476-5800669.post@n5.nabble.com>
* 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