CS-11945: Allow deleting of snapshots that have errored out. Simply mark the removed column as there is no physiocal clean up required

Reviewed-by: Kishan
This commit is contained in:
Nitin Mehta 2012-09-06 16:15:56 +05:30
parent 27de7bb9fa
commit a5241c89c7
1 changed files with 4 additions and 0 deletions

View File

@ -692,6 +692,10 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
if (snapshotCheck == null) {
throw new InvalidParameterValueException("unable to find a snapshot with id " + snapshotId);
}
if( Status.Error.equals(snapshotCheck.getStatus() ) ) {
_snapshotDao.remove(snapshotId);
return true;
}
if( !Status.BackedUp.equals(snapshotCheck.getStatus() ) ) {
throw new InvalidParameterValueException("Can't delete snapshotshot " + snapshotId + " due to it is not in BackedUp Status");
}