You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/08/27 10:04:57 UTC

[GitHub] [cloudstack] weizhouapache commented on a change in pull request #5373: server: do not remove volume from DB if fail to expunge it from primary storage or secondary storage

weizhouapache commented on a change in pull request #5373:
URL: https://github.com/apache/cloudstack/pull/5373#discussion_r697317698



##########
File path: server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java
##########
@@ -1411,7 +1411,15 @@ protected void expungeVolumesInPrimaryStorageIfNeeded(VolumeVO volume) throws In
         if (volOnPrimary != null) {
             s_logger.info("Expunging volume " + volume.getId() + " from primary data store");
             AsyncCallFuture<VolumeApiResult> future = volService.expungeVolumeAsync(volOnPrimary);
-            future.get();
+            VolumeApiResult result = future.get();
+            if (result.isFailed()) {
+                s_logger.warn("Failed to expunge the volume " + volume + " in primary storage");
+                String details = "";
+                if (result.getResult() != null && !result.getResult().isEmpty()) {
+                    details = result.getResult();
+                }
+                throw new CloudRuntimeException(details);
+            }

Review comment:
       @DaanHoogland sure. I will change it




-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org