> -----Original Message-----
> From: Tatsuo Ishii [mailto:t-ishii@sra.co.jp]
> Sent: 06 March 2003 15:17
> To: Dave Page
> Cc: pgsql-hackers@postgresql.org
> Subject: Re: [HACKERS] Win32 Powerfail testing
>
> I'm sure FlushFileBuffers() is usesless for files opend with
> open() too.
>
> As I said in the previlus mails, open()+_commit() does the
> right job with the transaction log files. So probably I think
> I should stick with open()+_commit() approach for ordinary
> table/index files too.
Oh, I didn't see that message. So it's either:
open() + _commit()
Or
CreateFile() + FlushFileBuffers()
Magnus also mentioned using FILE_FLAG_NO_BUFFERING or
FILE_FLAG_WRITE_THROUGH with CreateFile(). I was concerned about the
additional complexity with FILE_FLAG_NO_BUFFERING, but
FILE_FLAG_WRITE_THROUGH sounds like it might do the job, if a little
sub-optimally.
Is there really no way of allowing a decent write cache, but then being
able to guarantee a flush at the required time? Sounds a little cuckoo
to me but then it is Microsoft...
Anyhoo, it sounds like open() and _commit is this best choice as you
say.
Regards, Dave.