----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/20210/#review40039 -----------------------------------------------------------
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. - Min Chen 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 > >