JoaoJandre commented on code in PR #11448:
URL: https://github.com/apache/cloudstack/pull/11448#discussion_r2279037183
##########
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:
@sureshanaparti Since this object is used for every snapshot strategy and
type, I think that the safest is checking both. I could validate it for KVM
file-based snapshots and build a check based on that, but I can't guarantee it
will work for every case.
--
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]