[Sheepdog] [RFC PATCH v2 0/10] add a new store named 'farm'

Liu Yuan namei.unix at gmail.com
Fri Dec 23 18:29:32 CET 2011


On 12/24/2011 12:54 AM, Christoph Hellwig wrote:

> How do you plan to efficiently garbage-collect objects that aren't
> referenced anymore without a reference count?
> 


Yes, GC should be considered later for stale snapshot objects. With a
quick thought on this matter, I think simply compare timestamp of the
oid instead of counting them. That is, for a object, either

a) no content change, then point to the same old object (no stale object)
or
b) content updated, then will point to a new object with _newer_ epoch.

So we might need to remove stale object in case b), only when it is the
object generated by recovery code. [*]

Then we can store one bit as a flag in the header to mark if it is user
object (never stale until the user snapshot gets deleted).

GC could be structured on top of above concepts, though I am not sure it
works out in reality.

I guess we might trigger GC manually in the background or automatically
run triggered by some variable at recovery code.

[*] Here I assume we don't need to restore to 'sys epoch' state.

Thanks
Yuan



More information about the sheepdog mailing list