Subject Re: [firebird-support] Rdb$db_key inside triggers
Author Ann W. Harrison
Ivan Prenosil wrote:
>
> Since rdb$db_key values are guaranteed to be stable only inside transaction,
> I wonder how your replication works ...
>
That's probably stable enough for replication. The actual "instability"
of a db_key is that it can be reused if the record it identifies is
deleted, the delete matures, and the whole record is garbage collected.
There is currently an attachment option that "stabilizes" db_keys by
creating a dummy transaction in snapshot mode that stays open until the
connection closes.

That implementation of db_key stability totally inhibits garbage
collection. We could stabilize db_keys in a less disruptive way by
indicating - probably through the lock table - that deleted record stubs
are not to be garbage collected. The mechanism for turning that
stability on and off is non-trivial, but feasible. However, since
db_key stability doesn't seem to be a bit issue at the moment, there's
no real reason to tinker with it.

In Nigel's case, the record should have been replicated long before it
can be deleted, garbage collected, and have it's key reused.


Regards,


Ann