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

Manfred Spraul <manfred@colorfullife.com>

From: Manfred Spraul <manfred@colorfullife.com>
To: Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>, Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL-patches <pgsql-patches@postgresql.org>
Date: 2003-11-19T21:07:57Z
Lists: pgsql-hackers
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