Skip to content

Commit 091c21a

Browse files
committed
don't call vmInstanceDao.listByIdsIncludingRemoved with empty list.
1 parent 96c4652 commit 091c21a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,12 @@ private void syncOutOfBandBackups(final BackupProvider backupProvider, DataCente
17541754

17551755
private void updateBackupUsageRecords(final BackupProvider backupProvider, DataCenter dataCenter) {
17561756
List<Long> vmIdsWithBackups = backupDao.listVmIdsWithBackupsInZone(dataCenter.getId());
1757-
List<VMInstanceVO> vmsWithBackups = vmInstanceDao.listByIdsIncludingRemoved(vmIdsWithBackups);
1757+
List<VMInstanceVO> vmsWithBackups;
1758+
if (vmIdsWithBackups.size() == 0) {
1759+
vmsWithBackups = new ArrayList<>();
1760+
} else {
1761+
vmsWithBackups = vmInstanceDao.listByIdsIncludingRemoved(vmIdsWithBackups);
1762+
}
17581763
List<VMInstanceVO> vmsWithBackupOffering = vmInstanceDao.listByZoneAndBackupOffering(dataCenter.getId(), null); //should return including removed
17591764
Set<VMInstanceVO> vms = Stream.concat(vmsWithBackups.stream(), vmsWithBackupOffering.stream()) .collect(Collectors.toSet());
17601765

0 commit comments

Comments
 (0)