

> -----Original Message-----
> From: Tatsuo Ishii [mailto:t-ishii@sra.co.jp] 
> Sent: 05 March 2003 02:23
> To: pgsql-hackers@postgresql.org
> Subject: [HACKERS] Win32 Powerfail testing
>
> So far we found interesting facts. Our Win32 port passes his 
> test in most cases. However if power of the machine is turned 
> off right after (10 to 20 seconds) the Checkpoint has been 
> made, it does not passes his test. So we are thinking that 
> there is someting wrong with the checkpoint implementaion for 
> Win32 port, which is essentially same as Jan's 
> implementation. i.e. using _flushall() instead of sync().  We 
> were looking for a fix or an alternative implementaion of 
> sync() without success.

Hi Tatsuo,

Does this help:
http://support.microsoft.com/default.aspx?scid=kb;en-us;66052

Regards, Dave.

Wed, 5 Mar 2003 12:32:12 -0000
"Dave Page" <dpage@vale-housing.co.uk>
Re: Win32 Powerfail testing
> > So far we found interesting facts. Our Win32 port passes his 
> > test in most cases. However if power of the machine is turned 
> > off right after (10 to 20 seconds) the Checkpoint has been 
> > made, it does not passes his test. So we are thinking that 
> > there is someting wrong with the checkpoint implementaion for 
> > Win32 port, which is essentially same as Jan's 
> > implementation. i.e. using _flushall() instead of sync().  We 
> > were looking for a fix or an alternative implementaion of 
> > sync() without success.
> 
> Hi Tatsuo,
> 
> Does this help:
> http://support.microsoft.com/default.aspx?scid=kb;en-us;66052

Sorry, but it does not help. The page says we could use
FlushFileBuffers() to sync the kernel buffer to the
disk. Unfortunately, it requires a file descriptor to flush for its
argument. Thus it could not be a replacement of sync(). Actually I
have modified the buffer manager so that it remembers all file
descriptors those have not been synced yet to the disk at the
checkpoint time to sync them later. However I found this modification
does not help at all with some reason I don't know.
--
Tatsuo Ishii

Wed, 05 Mar 2003 22:49:27 +0900 (JST)
Tatsuo Ishii <t-ishii@sra.co.jp>
Re: Win32 Powerfail testing
On Wed, 5 Mar 2003, Dave Page wrote:

> 
> 
> > -----Original Message-----
> > From: Tatsuo Ishii [mailto:t-ishii@sra.co.jp] 
> > Sent: 05 March 2003 02:23
> > To: pgsql-hackers@postgresql.org
> > Subject: [HACKERS] Win32 Powerfail testing
> >
> > So far we found interesting facts. Our Win32 port passes his 
> > test in most cases. However if power of the machine is turned 
> > off right after (10 to 20 seconds) the Checkpoint has been 
> > made, it does not passes his test. So we are thinking that 
> > there is someting wrong with the checkpoint implementaion for 
> > Win32 port, which is essentially same as Jan's 
> > implementation. i.e. using _flushall() instead of sync().  We 
> > were looking for a fix or an alternative implementaion of 
> > sync() without success.
> 
> Hi Tatsuo,
> 
> Does this help:
> http://support.microsoft.com/default.aspx?scid=kb;en-us;66052

OMG, I'm rolling.  You have to connect to the COMMODE.OBJ to fix a 
flushing problem.  Someone at MS has a sense of humor.  I thought running 
PHP on crack was funny (i.e. --with-crack switch to turn on cracklib) but 
this one is even better.


Wed, 5 Mar 2003 10:10:23 -0700 (MST)
"scott.marlowe" <scott.marlowe@ihs.com>
Re: Win32 Powerfail testing
> > > So far we found interesting facts. Our Win32 port passes his 
> > > test in most cases. However if power of the machine is turned 
> > > off right after (10 to 20 seconds) the Checkpoint has been 
> > > made, it does not passes his test. So we are thinking that 
> > > there is someting wrong with the checkpoint implementaion for 
> > > Win32 port, which is essentially same as Jan's 
> > > implementation. i.e. using _flushall() instead of sync().  We 
> > > were looking for a fix or an alternative implementaion of 
> > > sync() without success.
> > 
> > Hi Tatsuo,
> > 
> > Does this help:
> > http://support.microsoft.com/default.aspx?scid=kb;en-us;66052
> 
> OMG, I'm rolling.  You have to connect to the COMMODE.OBJ to fix a 
> flushing problem.  Someone at MS has a sense of humor.  I thought running 
> PHP on crack was funny (i.e. --with-crack switch to turn on cracklib) but 
> this one is even better.

We have tried COMMODE.OBJ already. It seems that does not help at all.
--
Tatsuo Ishii

Thu, 06 Mar 2003 10:35:16 +0900 (JST)
Tatsuo Ishii <t-ishii@sra.co.jp>
Re: Win32 Powerfail testing
Tatsuo Ishii wrote:
> Sorry, but it does not help. The page says we could use
> FlushFileBuffers() to sync the kernel buffer to the
> disk. Unfortunately, it requires a file descriptor to flush for its
> argument. Thus it could not be a replacement of sync(). Actually I
> have modified the buffer manager so that it remembers all file
> descriptors those have not been synced yet to the disk at the
> checkpoint time to sync them later. However I found this modification
> does not help at all with some reason I don't know.

It would be an interesting comparison for you to roll the file
descriptor tracking changes into the Unix side of the tree and use
fsync() or fdatasync() in place of FlushFileBuffers() on the Unix side
(you'd have to remove or disable the code that does a sync() of
course).  If the end result yields no data corruption issues during
powerfail testing on various Unix platforms then it's reasonably
likely that the problem you're experiencing on the Windows side is
with the underlying Windows platform and not with your code.



-- 
Kevin Brown					      kevin@sysexperts.com

Wed, 5 Mar 2003 20:37:03 -0800
Kevin Brown <kevin@sysexperts.com>
Re: Win32 Powerfail testing
> It would be an interesting comparison for you to roll the file
> descriptor tracking changes into the Unix side of the tree and use
> fsync() or fdatasync() in place of FlushFileBuffers() on the Unix side
> (you'd have to remove or disable the code that does a sync() of
> course).  If the end result yields no data corruption issues during
> powerfail testing on various Unix platforms then it's reasonably
> likely that the problem you're experiencing on the Windows side is
> with the underlying Windows platform and not with your code.

Sounds like an idea. I'll do it if I have a spare time.
--
Tatsuo Ishii

Thu, 06 Mar 2003 17:18:58 +0900 (JST)
Tatsuo Ishii <t-ishii@sra.co.jp>
Re: Win32 Powerfail testing