Subject Re: [Firebird-Architect] FB2, read-commited and blobs
Author Vlad Horsun
> Vlad Horsun wrote:
> >>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 ?
>
> An easy first approximation is to leave the record version if it has a
> non-null blob field. That would get the right answer consistently and
> allow a lot more garbage collection than we do now.

I think we shouldn't check a blob values against null. Example

tx1 insert record with blob
tx1 commit

tx2 is a read-committed
tx2 read record and start to read blob

tx3 update record and set blob to null
tx3 commit

tx4 read record and must decide about garbage collection

At that point we have oldest_blob == 1. If tx4 check blob value in top record
version (made by tx3) it see null and decide to remove version made by tx1
and blob which tx2 is now reading

So we must leave all records with blob fields regardless of its values

> For the full
> implementation, we'll have to make changes to vio and blb so the going
> and staying lists are compiled before anything is removed and the blobs
> can be checked.

I don't know how we can change current implementation without big
performance loss but this is definitely not a today's question

Regards,
Vlad