Subject Re: [firebird-support] Reasons for Checksum Error
Author Ann W. Harrison
Stefan Heymann wrote:
> Is it possible that a crashing client connection leads to a corrupted
> database? Please tell me this is not true ...

No, it's not true. Here's the full scoop on checksums. Once upon a
time, in a cute little town called Groton, there was a database and
to be extra safe, it computed a checksum of every page just before
it wrote the page to disk,and wrote the checksum in the page header.
Immediately after it read the page, it computed the checksum again,
and if the stored checksum didn't match the computed checksum it
produced an error.

The error almost never occurred, and when it did occur, the stored
checksum was zero, and so was every other byte on the page.

Then the database moved to a lovely town in California called Santa
Cruz, where it had different friends who took care of it. Those
friends were looking for ways to make the database faster and their
tests showed that the database was spending a lot of time (5-10%)
computing checksums. So, they said, OK, 12345 is different from
zero, so we'll still catch the same errors, but we won't waste time
computing something that never fails.

It is possible that a crashing operating system or disk system can
leave pages of zeros in the database. A crashing client can't
except in local classic, since the client has no physical write
access to the database.