Subject Re: [ib-support] Corrupt header problem
Author Ann W. Harrison
At 11:52 PM 1/2/2002 +0000, polydwarf820 (Jason) wrote:


>For one reason or another (we haven't been able to pin it down), a
>customer calls in, saying that they're data is corrupt.

Jason,

Your analysis is pretty good, though I would like to make some
suggestions about reporting problems. First, specify the version
of Firebird or InterBase you're using. Different versions have
different problems. Second, give exact error messages - even if
that means pressuring your clients to say something more than
"my database is corrupt". Third, encourage your clients to backup
their databases regularly.

That said, your analysis is enough to tell me what happened - with
a 90% probability. You're running on a windows operating system and
you're using different connect strings for different clients. That
causes InterBase V4, V5, & V6 to attach the database once for each
connect string, breaking the lowest level of concurrency control -
the part that maintains the on-disk consistency.

The best solution is to convert to Firebird RC2, which will detect
that problem and prevent the corruption. The next best solution is
to move your databases from Windows to Linux (or Solaris, or HP, or
any grown-up operating system). The third best solution is to be
absolutely religious about connection strings - including the strings
used by the system administrator with IBConsole.

The "end of file" error occurs because the system is looking for a
transaction inventory page (80% probability) that did not get written.
If you increment the next transaction to some arbitrary value with
a hex editor, you may have made the system think that it has more
tips than were actually created.

The missing data occurs because the header page, which is the source
of transaction id's, was not written, so new transactions "think"
they're older than they are and that they're not "allowed" to read
data that should be committed.

If you are using InterBase I would suggest contacting Borland - this
is a very dangerous bug and one that they have swept under the table
for years. The problem can also show up as "wrong page type" and
several other, even less pleasant errors.



Regards,

Ann
www.ibphoenix.com
We have answers.