DaanHoogland commented on a change in pull request #3969: Snapshot deletion
issues
URL: https://github.com/apache/cloudstack/pull/3969#discussion_r406056673
##########
File path:
engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/snapshot/DefaultSnapshotStrategy.java
##########
@@ -352,14 +359,21 @@ private boolean deleteSnapshotOnSecondaryStorage(Long
snapshotId, SnapshotInfo s
}
/**
- * Deletes the snapshot on primary storage. It can return false when the
snapshot was not stored on primary storage; however this does not means that it
failed to delete the snapshot. </br>
- * In case of failure, it will throw one of the following exceptions:
CloudRuntimeException, InterruptedException, or ExecutionException. </br>
+ * Deletes the snapshot on primary storage. It returns true when the
snapshot was not found on primary storage; </br>
+ * In case of failure while deleting the snapshot, it will throw one of
the following exceptions: CloudRuntimeException, InterruptedException, or
ExecutionException. </br>
*/
private boolean deleteSnapshotOnPrimary(Long snapshotId, SnapshotInfo
snapshotOnPrimaryInfo) {
SnapshotDataStoreVO snapshotOnPrimary =
snapshotStoreDao.findBySnapshot(snapshotId, DataStoreRole.Primary);
- if (isSnapshotOnPrimaryStorage(snapshotId) &&
snapshotSvr.deleteSnapshot(snapshotOnPrimaryInfo)) {
- snapshotOnPrimary.setState(State.Destroyed);
- snapshotStoreDao.update(snapshotOnPrimary.getId(),
snapshotOnPrimary);
+ if (isSnapshotOnPrimaryStorage(snapshotId)) {
+ s_logger.debug("Snapshot reference is found on primary storage for
snapshot id:" + snapshotId + ", performing snapshot deletion on primary");
Review comment:
can you surround debug statements that include string manupulation in teh
paramater list with `if (LOG.isDebugEnables()) {}` please
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services