[sheepdog] [PATCH 2/2] sheep: release object cache when vdi is released

Liu Yuan namei.unix at gmail.com
Tue Jan 29 07:47:12 CET 2013


On 01/29/2013 02:39 PM, MORITA Kazutaka wrote:
> At Tue, 29 Jan 2013 13:22:06 +0800,
> Liu Yuan wrote:
>>  
>> +static int local_release_vdi(struct request *req)
>> +{
>> +	uint32_t vid = req->rq.vdi.base_vdi_id;
>> +
>> +	if (!vid) {
>> +		sd_iprintf("Some VDI failed to release the object cache. "
>> +			   "Probably you are running old QEMU.\n");
>> +		return SD_RES_SUCCESS;
>> +	}
>> +
>> +	object_cache_flush_vdi(vid);
>> +	object_cache_delete(vid);
> 
> I wonder if sheep should delete cache here.  With this patch, object
> cache cannot survive a temporal reboot of the guest os.  Is it
> expected behavior?
> 

This is a trade off. If we don't release the object cache, then VM can't
be safely restarted on another node without manually 'collie vdi cache
flush vm' on the previously hosted node.

As reboot of VM is really seldom operation ( EC2 even doesn't support
reboot & shutdown), I think we can trade this for intelligence that
doesn't require users to manually flush&del cache before migrating the
VM. I think live migration of VM need this cache behavior too.

Thanks,
Yuan




More information about the sheepdog mailing list