Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-03-17 Thread Tom Lane
Bruce Momjian writes: > Tom Lane wrote: >> ISTM Windows' idea of fsync is quite different from Unix's and therefore >> we should name the wal_sync_method that invokes it something different >> than fsync. "write_through" or some such? > Ah, I remember now. On Win32 our fsync is: > #define

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-03-17 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian writes: > > Tom Lane wrote: > >> ISTM Windows' idea of fsync is quite different from Unix's and therefore > >> we should name the wal_sync_method that invokes it something different > >> than fsync. "write_through" or some such? > > > Ah, I remember now. On Win32

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-03-17 Thread Dann Corbit
, 2005 10:53 AM To: Tom Lane Cc: Magnus Hagander; Michael Paesold; pgsql-hackers@postgresql.org; [EMAIL PROTECTED]; Merlin Moncure Subject: Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question Tom Lane wrote: > Bruce Momjian writes: > > However, I do prefer this patch and

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-03-17 Thread Tom Lane
Bruce Momjian writes: > Tom Lane wrote: >> we should name the wal_sync_method that invokes it something different >> than fsync. "write_through" or some such? We already have precedent >> that not all wal_sync_method values are available on all platforms. > Yes, I am thinking that too. I hesis

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-03-17 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian writes: > > However, I do prefer this patch and let Win32 have the same write cache > > issues as Unix, for consistency. > > I agree that the open flag is more nearly O_DSYNC than O_SYNC. > > ISTM Windows' idea of fsync is quite different from Unix's and therefore

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-03-17 Thread Tom Lane
Bruce Momjian writes: > However, I do prefer this patch and let Win32 have the same write cache > issues as Unix, for consistency. I agree that the open flag is more nearly O_DSYNC than O_SYNC. ISTM Windows' idea of fsync is quite different from Unix's and therefore we should name the wal_sync_m

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-03-17 Thread Bruce Momjian
Magnus Hagander wrote: > > This indicated to me that open_sync did not require any > > additional changes than our current fsync. > > fsync and open_sync both write through the write cache in the operating > system. Only fsync=off turns this off. > > fsync also writes through the hardware write

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-03-17 Thread Magnus Hagander
> > > > * Win32, with fsync, write-cache disabled: no data corruption > > > > * Win32, with fsync, write-cache enabled: no data corruption > > > > * Win32, with osync, write cache disabled: no data corruption > > > > * Win32, with osync, write cache enabled: no data > corruption. Once > > > > I >

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-03-16 Thread Michael Paesold
Bruce Momjian wrote: Michael Paesold wrote: Magnus Hagander wrote: [snip] Michael, I am not sure why you come to the conclusion that open_sync requires turning off the disk write cache. I saw nothing to indicate that in the thread: I was just seeing his error message below... http://archives.postg

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-03-16 Thread Bruce Momjian
Michael Paesold wrote: > Magnus Hagander wrote: > > > >> Magnus Hagander wrote: > >>> > Magnus prepared a trivial patch which added the O_SYNC flag > >>> > for windows and mapped it to FILE_FLAG_WRITE_THROUGH in > >>> > win32_open.c. > [snip] > > > Michael Paesold wrote: > >>The original patch d

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-02-28 Thread Dave Page
-Original Message- From: [EMAIL PROTECTED] on behalf of Bruce Momjian Sent: Sun 2/27/2005 12:54 AM To: Magnus Hagander Cc: Tom Lane; pgsql-hackers@postgresql.org; [EMAIL PROTECTED]; Merlin Moncure Subject: Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question > Pa

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-02-27 Thread Magnus Hagander
e; pgsql-hackers@postgresql.org; >[EMAIL PROTECTED]; Merlin Moncure >Subject: Re: [pgsql-hackers-win32] [HACKERS] win32 performance >- fsync question > > > >Patch applied. Thanks. > >I assume this is not approprate for 8.0.X. > >-

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-02-25 Thread Zeugswetter Andreas DAZ SD
> >Are you verifying that all the data that was committed was actually stored? > >Or > >just verifying that the database works properly after rebooting? > > I verified the data. Does pg startup increase the xid by some amount (say 1000 xids) after crash ? Else I think you would also need to rol

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-02-24 Thread Greg Stark
"Magnus Hagander" <[EMAIL PROTECTED]> writes: > > I'm a bit surprised that the write-cache lead to a corrupt database, and > > not merely lost transactions. I had the impression that drives still > > handled the writes in the order received. > > In this case, it was lost transactions, not data c

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-02-24 Thread Magnus Hagander
>> * Linux, with fsync (default), write-cache enabled: usually no data >> corruption, but two runs which had > >Are you verifying that all the data that was committed was >actually stored? Or >just verifying that the database works properly after rebooting? I verified the data. >I'm a bit surpr

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-02-24 Thread Magnus Hagander
>> You may find that if you check this case again that the >"usually no data >> corruption" is actually "usually lost transactions but no >corruption". > >That's a good point, but it seems difficult to be sure of the last >reportedly-committed transaction in a powerfail situation. Maybe if >you

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-02-24 Thread Greg Stark
Tom Lane <[EMAIL PROTECTED]> writes: > Greg Stark <[EMAIL PROTECTED]> writes: > > I'm a bit surprised that the write-cache lead to a corrupt database, and not > > merely lost transactions. I had the impression that drives still handled the > > writes in the order received. > > There'd be little

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-02-24 Thread Tom Lane
Greg Stark <[EMAIL PROTECTED]> writes: > I'm a bit surprised that the write-cache lead to a corrupt database, and not > merely lost transactions. I had the impression that drives still handled the > writes in the order received. There'd be little point in having a cache if they did, I should think

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-02-24 Thread Greg Stark
"Magnus Hagander" <[EMAIL PROTECTED]> writes: > * Linux, with fsync (default), write-cache enabled: usually no data > corruption, but two runs which had Are you verifying that all the data that was committed was actually stored? Or just verifying that the database works properly after rebooting?

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync

2005-02-24 Thread pgsql
> "Magnus Hagander" <[EMAIL PROTECTED]> writes: >> My results are: >> Fisrt, baseline: >> * Linux, with fsync (default), write-cache disabled: no data corruption >> * Linux, with fsync (default), write-cache enabled: usually no data >> corruption, but two runs which had > > That makes sense. > >> *

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-02-24 Thread Magnus Hagander
> > * Win32, with fsync, write-cache disabled: no data corruption > > * Win32, with fsync, write-cache enabled: no data corruption > > * Win32, with osync, write cache disabled: no data corruption > > * Win32, with osync, write cache enabled: no data corruption. Once I > > got: > > 2005-02-24 12:19

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-02-24 Thread Tom Lane
"Magnus Hagander" <[EMAIL PROTECTED]> writes: > My results are: > Fisrt, baseline: > * Linux, with fsync (default), write-cache disabled: no data corruption > * Linux, with fsync (default), write-cache enabled: usually no data > corruption, but two runs which had That makes sense. > * Win32, with

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-02-24 Thread Christopher Kings-Lynne
My results are: Fisrt, baseline: * Linux, with fsync (default), write-cache disabled: no data corruption * Linux, with fsync (default), write-cache enabled: usually no data corruption, but two runs which had * Win32, with fsync, write-cache disabled: no data corruption * Win32, with fsync, write-ca

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-02-24 Thread Christopher Kings-Lynne
In the final test, the BIOS decided the disk was giving up and reassigned it as 0Mb.. Required two extra cold boots, then it was back up to 20Gb. Still no data loss. I think it would be fun to re-run these tests with MySQL... Chris ---(end of broadcast)--

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-02-24 Thread Magnus Hagander
> > Magnus prepared a trivial patch which added the O_SYNC flag for > > windows and mapped it to FILE_FLAG_WRITE_THROUGH in win32_open.c. > > Attached is this trivial patch. As Merlin says, it needs some > more reliability testing. But the numbers are at least reasonable - it > *seems* like it's

Re: [pgsql-hackers-win32] [HACKERS] win32 performance - fsync question

2005-02-20 Thread Magnus Hagander
>> Magnus prepared a trivial patch which added the O_SYNC flag >> for windows and mapped it to FILE_FLAG_WRITE_THROUGH in >> win32_open.c. > >Attached is this trivial patch. As Merlin says, it needs some more >reliability testing. But the numbers are at least reasonable - it >*seems* like it's d