sureshanaparti commented on code in PR #11448:
URL: https://github.com/apache/cloudstack/pull/11448#discussion_r2278890767


##########
engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/snapshot/SnapshotObject.java:
##########
@@ -172,10 +172,15 @@ public boolean isRevertable() {
     @Override
     public long getPhysicalSize() {
         long physicalSize = 0;
-        SnapshotDataStoreVO snapshotStore = 
snapshotStoreDao.findByStoreSnapshot(DataStoreRole.Image, store.getId(), 
snapshot.getId());
-        if (snapshotStore != null) {
-            physicalSize = snapshotStore.getPhysicalSize();
+        for (DataStoreRole role : List.of(DataStoreRole.Image, 
DataStoreRole.Primary)) {
+            logger.trace("Retrieving snapshot [{}] size from {} storage.", 
snapshot.getUuid(), role);
+            SnapshotDataStoreVO snapshotStore = 
snapshotStoreDao.findByStoreSnapshot(role, store.getId(), snapshot.getId());

Review Comment:
   @JoaoJandre does SnapshotObject have any details about its location 
Secondary or Primary? and Can use it instead of checking in both?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to