CLOUDSTACK-8101: volume sync not working as expected - MS restart during upload volume leaves volume in hung state.

This commit is contained in:
Min Chen 2014-12-19 16:48:45 -08:00
parent ea634550fc
commit e559b15b6a

View File

@ -1382,8 +1382,8 @@ public class VolumeServiceImpl implements VolumeService {
return;
}
// we can only resume those uploaded volume with a URL specified
List<VolumeDataStoreVO> dbVolumes = _volumeStoreDao.listUploadedVolumesByStoreId(storeId);
// find all the db volumes including those with NULL url column to avoid accidentally deleting volumes on image store later.
List<VolumeDataStoreVO> dbVolumes = _volumeStoreDao.listByStoreId(storeId);
List<VolumeDataStoreVO> toBeDownloaded = new ArrayList<VolumeDataStoreVO>(dbVolumes);
for (VolumeDataStoreVO volumeStore : dbVolumes) {
VolumeVO volume = volDao.findById(volumeStore.getVolumeId());