[sheepdog] [Sheepdog] [PATCH 1/2] traverse the VDI tree before delete cloned VDI

Liu Yuan namei.unix at gmail.com
Wed May 16 15:54:25 CEST 2012


On 05/07/2012 01:45 PM, levin li wrote:

> Even if the VDI is a cloned VDI (not the VDI just created
> by 'clone' operation, but the cloned VDI on the leaf node
> of the VDI tree), we also should traverse the vdi tree from
> the root VDI.
> 
> But if there's a VDI not deleted in the tree path, and the
> VDI to delete is a cloned VDI, we should delete it's data
> objects so as to save disk space. If all the VDIs have been
> deleted in the tree path, then we traverse the path to delete
> all the objects of the VDIs.
> 
> I'd like to explain again why we need to deleted the objects
> created by copy-on-write when we try to delete a cloned VDI,
> in the old logic, objects of cloned VDI can only be deleted
> after all the VDI in the tree path has been deleted, but there's
> a problem, we may clone many VDIs from one snapshot, and these
> VDIs can be deleted frequently, but we may always not delete the
> snapshot VDI, so in this case, objects of cloned VDI would
> always stay in the disk, as we know, they're already useless
> and should be deleted, and waste too much disk space, but we can
> only make it deleted after all the VDI in the tree path, including
> the snapshot VDI have beed deleted, it's really not good.


Applied, thanks.

Yuan



More information about the sheepdog mailing list