> On April 10, 2014, 5:25 p.m., Min Chen wrote:
> > The root cause for this issue is that we didn't remove template_store_ref 
> > entry from db when a template is deleted from a zone and only mark them as 
> > 'Destroyed'. In addition, template_view db view is created by joining with 
> > those destroyed entries in template_store_ref as well, which causing it to 
> > only randomly pick the entry that may be 'Destroyed'.  The much simpler fix 
> > to me is to remove entries from template_store_ref table at the end of 
> > deleting template flow when the deletion is successful (since they have 
> > already been deleted from secondary storage) instead of finding and then 
> > manually updating entry done in the patch.

Hi Min,

The template_view dose the correct thing here. This problem occurs because we 
set the template state as destroyed but we do not mark the destroyed flag to 
true. The template view picks all the entries where destroyed flag is false, 
since even the deleted templates have this set to false they are also getting 
populated in the template_view table. 


- bharat


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/20210/#review40039
-----------------------------------------------------------


On April 10, 2014, 3:04 p.m., bharat kumar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/20210/
> -----------------------------------------------------------
> 
> (Updated April 10, 2014, 3:04 p.m.)
> 
> 
> Review request for cloudstack, Kishan Kavala and Min Chen.
> 
> 
> Bugs: CLOUDSTACK-6377
>     https://issues.apache.org/jira/browse/CLOUDSTACK-6377
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> -------
> 
> List templates returns destroyed temples when copying the same template after 
> deleting.
> https://issues.apache.org/jira/browse/CLOUDSTACK-6377
> 
> 
> Diffs
> -----
> 
>   
> engine/api/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreDao.java
>  048ce22 
>   
> engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
>  d9a5164 
>   
> engine/storage/src/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java
>  f5140e0 
>   server/src/com/cloud/template/HypervisorTemplateAdapter.java 963aec9 
> 
> Diff: https://reviews.apache.org/r/20210/diff/
> 
> 
> Testing
> -------
> 
> Tested on 4.2
> 
> 
> Thanks,
> 
> bharat kumar
> 
>

Reply via email to