diff --git a/service/daemon/reconciler/src/main/kotlin/vdi/daemon/reconciler/ReconcilerInstance.kt b/service/daemon/reconciler/src/main/kotlin/vdi/daemon/reconciler/ReconcilerInstance.kt index 9b3e9bb3..b11a60d1 100644 --- a/service/daemon/reconciler/src/main/kotlin/vdi/daemon/reconciler/ReconcilerInstance.kt +++ b/service/daemon/reconciler/src/main/kotlin/vdi/daemon/reconciler/ReconcilerInstance.kt @@ -96,17 +96,19 @@ internal class ReconcilerInstance( // Delete datasets until and advance target iterator until streams are aligned. while (nextTargetDataset != null && comparableS3Id.compareTo(comparableTargetId!!, false) > 0) { - log.info( - "attempting to delete dataset {} because {} is lexicographically greater than {}. Presumably {} is not " + - "in MinIO", - comparableTargetId, - comparableS3Id, - comparableTargetId, - comparableTargetId - ) - - if (!slim) + if (!slim) { + log.info( + "attempting to delete dataset {} because {} is lexicographically greater than {}. Presumably {} is not " + + "in MinIO", + comparableTargetId, + comparableS3Id, + comparableTargetId, + comparableTargetId + ) + tryDeleteDataset(targetDB, nextTargetDataset!!) + } + nextTargetDataset = if (targetIterator.hasNext()) targetIterator.next() else null comparableTargetId = nextTargetDataset?.getComparableID() }