CS-16135: Create volume after upgrade from snapshot taken in 2.2.14 deletes the snapshot physically from sec. storage. Added DB upgrade sql to make swift_id NULL if they are set to 0 and also added a check in the code to check for swift not present by checking swift_id != null && !=0

Reviewed-by: Kishan
This commit is contained in:
Nitin Mehta 2012-08-22 19:56:36 +05:30
parent c4257acc41
commit bc8bdf8723
2 changed files with 3 additions and 1 deletions

View File

@ -713,7 +713,7 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag
} catch (StorageUnavailableException e) {
s_logger.error(basicErrMsg);
} finally {
if (snapshot.getSwiftId() != null) {
if (snapshot.getSwiftId() != null && snapshot.getSwiftId() != 0) {
_snapshotMgr.deleteSnapshotsDirForVolume(secondaryStoragePoolUrl, dcId, accountId, volumeId);
}
_snapshotDao.unlockFromLockTable(snapshotId.toString());

View File

@ -379,3 +379,5 @@ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Usage', 'DEFAULT', 'manageme
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Usage', 'DEFAULT', 'management-server', 'traffic.sentinel.exclude.zones', '', 'Traffic going into specified list of zones is not metered');
DROP TABLE IF EXISTS `cloud`.`ovs_tunnel_account`;
UPDATE `cloud`.`snapshots` set swift_id=null where swift_id=0;