Re: [pgsql-hackers-win32] SRA Win32 sync() code - Mailing list pgsql-patches

From Manfred Spraul
Subject Re: [pgsql-hackers-win32] SRA Win32 sync() code
Date
Msg-id 3FBBDBAD.8050903@colorfullife.com
Whole thread Raw
In response to Re: [pgsql-hackers-win32] SRA Win32 sync() code  (Shridhar Daithankar <shridhar_daithankar@persistent.co.in>)
List pgsql-patches
Shridhar Daithankar wrote:

>Does 30% difference above count as significant?
>
>
No. It's Linux, we can look at the sources: there is no per-fd cache,
the page cache is global. Thus fsync() syncs the whole cache to disk.
A problem could only occur if the file cache is not global - perhaps a
per-node file cache on NUMA systems - IRIX on an Origin 2000 cluster or
something similar.

But as I read the unix spec, fsync is guaranteed to sync all data to disk:
Draft 6 of the posix-200x spec:
SIO If _POSIX_SYNCHRONIZED_IO is defined, the fsync( ) function shall
force all currently queued I/O operations associated with the file
indicated by file descriptor fildes to the synchronized I/O completion
state. All I/O operations shall be completed as defined for synchronized
I/O file integrity completion.

"All I/O operations associated with the file", not all operations
associated with the file descriptor.

--
    Manfred


pgsql-patches by date:

Previous
From: Kurt Roeckx
Date:
Subject: Re: [pgsql-hackers-win32] SRA Win32 sync() code
Next
From: Philip Yarra
Date:
Subject: Fwd: quick ECPG doco change