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

(Updated Sept. 11, 2012, 2:38 p.m.)


Review request for cloudstack and Nitin Mehta.


Changes
-------

Sumarry of changes:

Changed the function addTemplateToZone VMTemplateDaoImpl.java.
This was needed as the previous version tried to update the removed column of 
the row in template_zone_ref table in database.
The removed column cannot be updated once it is set to some value other than 
NULL (i.e. a time stamp which tell when the template was removed).
This caused the recopying of the template (After deleting it once ) to fail. So 
now we add a new row while recopying the template if it dose
not exist and update the time and date in the database if it exists already.

Changed the copy function and the copyTemplate function in 
TemplateManagerImpl.java.
This file now has a check to avoid copying of template even if there is one 
already in the zone and it re initiates the copy job if the
user tries to recopy the template again while it is in error state and does not 
do anything if the template is already downloaded or is
being downloaded.

Changed the delete function in HyervisorTemplateAdapter.java file.
It uses the findByZoneTemplate function in the delete function to remove the 
template. This function fetches any entry which matches
the template id and the zone id, It dose not check for the value of the removed 
column. So we have used a function listByZoneTemplate
which retrieves only the rows where templateid, zoneid, and removed is equal to 
NULL match. (Note that at any time we can have only
one row which matches the above mentioned criteria.) As a result it dose not 
update the rows where removed is not NULL i.e. entries
corresponding to earlier deletions of the same template.


Summary (updated)
-----------------

This bug fix adds new rows in the template_zone_ref rather than changing the 
removed column in the existing entries which correspond to previous deletions 
of the same  template. 


Description
-------

This bug fix (CS-14673) deals with the database aspects of template creation, 
this changes the way in which the entries are added and removed from 
template_zone_ref and template_host_ref.

 


Diffs
-----

  server/src/com/cloud/storage/dao/VMTemplateDaoImpl.java 2a0dfc8 
  server/src/com/cloud/template/HyervisorTemplateAdapter.java bdb89f6 
  server/src/com/cloud/template/TemplateManagerImpl.java 1e87de2 

Diff: https://reviews.apache.org/r/7018/diff/


Testing
-------

I have tested this on the asf branch.


Thanks,

bharat kumar

Reply via email to