[Sheepdog] [PATCH] fix a bug of deleting base vdi fail

MORITA Kazutaka morita.kazutaka at gmail.com
Thu May 3 17:56:35 CEST 2012


At Thu, 03 May 2012 09:48:47 +0800,
levin li wrote:
> 
> On 05/03/2012 12:12 AM, Christoph Hellwig wrote:
> > On Wed, May 02, 2012 at 12:03:18PM +0800, Li Wenpeng wrote:
> >> From: levin li<xingke.lwp at taobao.com>
> >>
> >> Take a view of the following snapshot chain:
> >>
> >> base vdi -->  snapshot vdi -->  cloned vdi
> >>
> >> when cloned vdi has its own data objects created by copy-on-write,
> >> we firstly delete the cloned vdi, the delete the base vdi, at last
> >> we delete snapshot vdi.
> >>
> >> when deleting the snapshot vdi, it try to traverse the snapshot chain to
> >> cleanup all the data objects, but the copy-on-write objects has been
> >> deleted by the first deletion work, so it may get failed and set the
> >> dw->delete_error to be true, it doesn't matter for the future deletion,
> >> we just need to guarantee the objects of the snapshot vdi deleteing success,
> >> but before this, we need to clear the previous error flag at dw->delete_error,
> >> orelse it may cause failure of deleting the snapshot vdi.
> > Can you post a list of command lines to reproduce this issue?  That we
> > we can add it to the upcoming regression test suite.
> Here's my test script:
> 
> for i in 0 1 2; do
>      echo "initializing sheep on port 700$i"
>      sheep/sheep -d /home/levin/disk/store/$i -p 700$i -z $i;
>      sleep 1;
> done
> 
> collie/collie cluster format -c 3 -b "farm"
> 
> # linux-0.2.img is small linux image file.
> qemu-img convert ~/linux-0.2.img sheepdog:linux
> qemu-img snapshot -c snap sheepdog:linux
> qemu-img create -b sheepdog:linux:1 sheepdog:test

This line fails because 'qemu-img snapshot' updates the vdi object on
the disk, but doesn't update the cached data.

Kazutaka



More information about the sheepdog mailing list