Subject Re: [firebird-support] Bad indexes - expected 7 encountered 5 - Classic
Author Ann W. Harrison
Bob Murdoch wrote:

>
> I'm not sure about the crashes. Our systems are built to be tolerant
> of database disconnects, and unfortunately we do not log this type of
> activity.
>
> However, within a single transaction we will delete between 10k - 70k
> rows, and insert nearly the same amount. Most likely, 80-90% of the
> newly inserted rows are duplicates of the just-deleted rows.
>

My description of the "delete" was careless. Index entries are
deleted when the record version is garbage collected, so the
transaction that does the delete won't actually remove anything
from the index, but some later transaction will. And, of course,
a transaction that modifies an indexed fields will immediately
enter the new value in the index. Eventually some other
transaction will remove the old value after the new version is
committed and all active transactions see that version.

But, for the particular bug to happen, there have to be at
least two connections active - one removing old versions and
one inserting new versions. The first could be a report or
other read-only app that happens to be dragooned into garbage
collection.

Regards,


Ann