File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
schema/src/main/java/com/cloud/storage/dao
storage/volume/src/main/java/org/apache/cloudstack/storage/volume Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -579,17 +579,16 @@ public long secondaryStorageUsedForAccount(long accountId) {
579579
580580 @ Override
581581 public List <VolumeVO > listVolumesToBeDestroyed () {
582- SearchCriteria <VolumeVO > sc = AllFieldsSearch .create ();
583- sc .setParameters ("state" , Volume .State .Destroy );
584-
585- return listBy (sc );
582+ return listVolumesToBeDestroyed (null );
586583 }
587584
588585 @ Override
589586 public List <VolumeVO > listVolumesToBeDestroyed (Date date ) {
590587 SearchCriteria <VolumeVO > sc = AllFieldsSearch .create ();
591- sc .setParameters ("state" , Volume .State .Destroy );
592- sc .setParameters ("updateTime" , date );
588+ sc .setParameters ("state" , Volume .State .Destroy , Volume .State .Expunging );
589+ if (date != null ) {
590+ sc .setParameters ("updateTime" , date );
591+ }
593592
594593 return listBy (sc );
595594 }
Original file line number Diff line number Diff line change @@ -434,6 +434,9 @@ public AsyncCallFuture<VolumeApiResult> expungeVolumeAsync(VolumeInfo volume) {
434434 // no need to change state in volumes table
435435 volume .processEventOnly (Event .DestroyRequested );
436436 } else if (volume .getDataStore ().getRole () == DataStoreRole .Primary ) {
437+ if (vol .getState () == Volume .State .Expunging ) {
438+ logger .info ("Volume {} is already in Expunging, retrying" , volume );
439+ }
437440 volume .processEvent (Event .ExpungeRequested );
438441 }
439442
You can’t perform that action at this time.
0 commit comments