Subject Re: [Firebird-Architect] FB2, read-commited and blobs
Author Vlad Horsun
> 7) In garbage collection, notice whether the record has blobs. If so,
> check both oldest_active and oldest_blob before removing old versions.

I have a problem with implementation of this last step. Question is
when we can make such check ? At the first look most appropriate
place for it is a BLB_garbage_collect as it have a going and staying
list of record versions and can compare blobs in this lists.
Unfortunately it is to late to cancel record's garbage collection in
BLB_garbage_collect as its caller already deleted all versions in
chain.

We can make this check in purge but as it have record_param without
record fetched we need to call VIO_data before cutting version's chain.
This call is extra overhead and i don't know how big. And we have not
a going and staying lists here hence we'll cancel gc of each record
with blobs (not only that which have the same blobs in going and staying
lists). Maybe we will cancel gc for records with blob fields not looking
in actual data ? This is dumb but simple decision...

Another solution can be a new records flag. We set this flag when we
modify record and any blob field in it is changed. We also set it when
record is deleted. When we make new version we set this flag if it is was
set in prior version. And we reset flag when we truncate record chain. I.e.
this flag meaning is something like 'some versions in chain have different
blobs in the same field'.

Opinions ?

Regards,
Vlad