CLOUDSTACK-7966:

remove snapshot_store_ref entry, in which role is Primary, during
storage GC

(cherry picked from commit 7175247c5e)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Edison Su 2014-11-24 14:25:29 -08:00 committed by Rohit Yadav
parent 404a5e757c
commit 3006f5cc83
1 changed files with 4 additions and 0 deletions

View File

@ -1150,6 +1150,10 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
}
_snapshotDao.remove(destroyedSnapshotStoreVO.getSnapshotId());
SnapshotDataStoreVO snapshotOnPrimary = _snapshotStoreDao.findBySnapshot(destroyedSnapshotStoreVO.getSnapshotId(), DataStoreRole.Primary);
if (snapshotOnPrimary != null) {
_snapshotStoreDao.remove(snapshotOnPrimary.getId());
}
_snapshotStoreDao.remove(destroyedSnapshotStoreVO.getId());
}