Subject Re: [firebird-support] Re: Broken Database after system crash on W2K
Author Lester Caine
Tim wrote:

> At 15:20 12/01/2005, you wrote:
>>
>>I agree, but I already know how to deploy a reliable system. I only
>>want to know why this occurr always on W2K and not in Linux. Perhaps
>>I've done a wrong db configuration, or simply W2K is not reliable
>>after power failures...

While you can make windows safer, UPS is the only reliable option, along
with mirrored backup to a second machine in case of disk or PSU failure.
For Windows or Linux! Windows just need more work to bring it up to the
Linux standard of reliability to start with.

> IMHO, the people you need to ask are Ann Harrison and/or Helen. In my
> experience, windows has a large cache that it (the O/S) manages. It writes
> stuff to this cache before writing to disk. I think (and I am not sure)
> that Windows has a larger cache than Linux does; or maybe Linux handles
> things completely differently; or that Windows uses a single (large) cache
> for all the running programs before writing to Disk.
>
> Because the OS manages this cache, not even a commit writes stuff to disk
> immediately.

Windows seems to have a mind of it's own, and at least up to and
including W2k, you can not rely in what will happen if the power is
killed while running. We have yet to get XP to pass the long term tests
for stability. The FORCED_WRITE issue is one of basically forcing
Windows to empty the caches - even after you have used the API calls
that are supposed to do it. You have to ensure that even lower level
things are used.

> Anyway - the problem of corrupted DBs doesn't only apply to FB. I have had
> exactly the same experience using dBase. You have to force the OS to write
> to disk immediately after a post in order to ensure that it does get
> written before anything else happens.

It was one of the reasons we switched to the codebase library early on.
dBase would always loose data, codebase would only loose what had not
been actually saved. dBase ( and Interbase ) lost all the data from the
start of the day (the last time you started the program)!

> I think that one of the reasons windows takes so long to shut down is that,
> apart from all the other stuff it has to do, it also has to write all the
> stuff in this cache to disk.

And of cause XP is a lot slower shutting down because it is tidying
things up so that it STARTS faster. I've not been able to prove it, but
I am sure the Start+Stop time is longer in XP - you need a faster
machine just to run it anyway ;) . Yes it boots quicker, but you have to
wait longer before you can go home. My customers would rather get out of
the office quicker. Without the tidy up on shut down ( i.e. after a
power fail ) XP can take a long time to come up, and usually needs
things tweaking before you get back to where you were - it's not just
the database stuff that gets upset.

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services