[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-3305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13797980#comment-13797980
 ] 

Marcus Sorensen commented on CLOUDSTACK-3305:
---------------------------------------------

Template sync should probably look at timestamp of templates, and maybe have a 
global config that only cleans up templates once they're X minutes old (default 
1440 or something like that).

> TemplateSync Deletes the templates in creation state from Seconday storage.
> ---------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-3305
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-3305
>             Project: CloudStack
>          Issue Type: Improvement
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>    Affects Versions: 4.2.0
>            Reporter: Nitin Mehta
>            Assignee: Nitin Mehta
>             Fix For: Future
>
>
> this is what is happening. 
> 1. Template creation from snapshot triggered. Work going on, but there is no 
> update in DB that there is Work in Progress (//TODO Fix this Long term by 
> putting an intermediate state) 
> 2. Work gets complete and the agent returns back. We dont update the DB and 
> send a computechecksum command to SSVM. (//TODO Long term - The create 
> template itself should return the checksum - fix needed at ssvm for vmware 
> and at citrix/libvrt resourcebase for XS and KVM) 
> 3. Template sync gets triggered (because of unhealthy ssvm connecting back 
> and forth with MS) and reports this template to the MS being on secondary 
> storage, but we have no record that WIP in DB. So template sync deletes the 
> template on SS. (//TODO short term - Should we be aggressive to delete the 
> template or just sending an alert is fine ? Or if we can just relax and maybe 
> delete in the next run or do more checking ?) 
> 4. Compute checksum returns and DB is updated that a template is created and 
> put into Ready status, but underlying it go deleted. 
> For now I have changed the compute checksum logic after updating the DB that 
> template is created. See the commit above for more information. BUT, this 
> doesnt completely eliminate the race condition. There would still be a window 
> where before updating the DB sync mechanism deletes the template (I think 
> this should happen rarely), 
> I can also make the fix possible in #3 (//TODO short term - Should we be 
> aggressive to delete the template or just sending an alert is fine)



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to