Add volumes in 'Expunging' state to storage cleanup thread and during delete storage pool (#12602)

This commit is contained in:
Suresh Kumar Anaparti 2026-02-19 00:38:25 +05:30 committed by GitHub
parent 8b38cea33c
commit 32c0cdbed9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 7 deletions

View File

@ -382,7 +382,7 @@ public class VolumeDaoImpl extends GenericDaoBase<VolumeVO, Long> implements Vol
public VolumeDaoImpl() {
AllFieldsSearch = createSearchBuilder();
AllFieldsSearch.and("state", AllFieldsSearch.entity().getState(), Op.EQ);
AllFieldsSearch.and("state", AllFieldsSearch.entity().getState(), Op.IN);
AllFieldsSearch.and("accountId", AllFieldsSearch.entity().getAccountId(), Op.EQ);
AllFieldsSearch.and("dcId", AllFieldsSearch.entity().getDataCenterId(), Op.EQ);
AllFieldsSearch.and("pod", AllFieldsSearch.entity().getPodId(), Op.EQ);
@ -579,17 +579,16 @@ public class VolumeDaoImpl extends GenericDaoBase<VolumeVO, Long> implements Vol
@Override
public List<VolumeVO> listVolumesToBeDestroyed() {
SearchCriteria<VolumeVO> sc = AllFieldsSearch.create();
sc.setParameters("state", Volume.State.Destroy);
return listBy(sc);
return listVolumesToBeDestroyed(null);
}
@Override
public List<VolumeVO> listVolumesToBeDestroyed(Date date) {
SearchCriteria<VolumeVO> sc = AllFieldsSearch.create();
sc.setParameters("state", Volume.State.Destroy);
sc.setParameters("updateTime", date);
sc.setParameters("state", Volume.State.Destroy, Volume.State.Expunging);
if (date != null) {
sc.setParameters("updateTime", date);
}
return listBy(sc);
}

View File

@ -434,6 +434,9 @@ public class VolumeServiceImpl implements VolumeService {
// no need to change state in volumes table
volume.processEventOnly(Event.DestroyRequested);
} else if (volume.getDataStore().getRole() == DataStoreRole.Primary) {
if (vol.getState() == Volume.State.Expunging) {
logger.info("Volume {} is already in Expunging, retrying", volume);
}
volume.processEvent(Event.ExpungeRequested);
}