Skip to content

Commit 8f63c2c

Browse files
minchen07chaturvedia
authored andcommitted
CLOUDSTACK-6017: NPE while creating snapshot multiple times on same Root
volume with S3 as secondary storage. (cherry picked from commit 4022543) Signed-off-by: Animesh Chaturvedi <animesh@apache.org>
1 parent 91ec548 commit 8f63c2c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,10 @@ public void processEvent(ObjectInDataStoreStateMachine.Event event, Answer answe
288288
} else if (answer instanceof CopyCmdAnswer) {
289289
SnapshotObjectTO snapshotTO = (SnapshotObjectTO) ((CopyCmdAnswer) answer).getNewData();
290290
snapshotStore.setInstallPath(snapshotTO.getPath());
291-
snapshotStore.setSize(snapshotTO.getPhysicalSize());
291+
if (snapshotTO.getPhysicalSize() != null) {
292+
// For S3 delta snapshot, physical size is currently not set
293+
snapshotStore.setSize(snapshotTO.getPhysicalSize());
294+
}
292295
if (snapshotTO.getParentSnapshotPath() == null) {
293296
snapshotStore.setParentSnapshotId(0L);
294297
}

0 commit comments

Comments
 (0)