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

levin li levin108 at gmail.com
Thu May 3 03:48:47 CEST 2012


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

sleep 1
qemu-system-i386 -m 64 -hda sheepdog:test

# close qemu after linux setup successfully.

sleep 1
collie/collie vdi delete test

sleep 1
collie/collie vdi delete linux

sleep 1
collie/collie vdi delete -s 1 linux

sleep 3
collie/collie vdi list

Note that without this patch 
(http://lists.wpkg.org/pipermail/sheepdog/2012-May/003284.html) 
<http://lists.wpkg.org/pipermail/sheepdog/2012-May/003284.html>
sheep will stop this script from working correctly.

thanks,
levin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog/attachments/20120503/00b1d62d/attachment-0003.html>


More information about the sheepdog mailing list