|
20 | 20 | import org.zstack.header.storage.primary.GetVolumeBackingChainFromPrimaryStorageMsg;
|
21 | 21 | import org.zstack.header.storage.primary.GetVolumeBackingChainFromPrimaryStorageReply;
|
22 | 22 | import org.zstack.header.storage.primary.PrimaryStorageConstant;
|
23 |
| -import org.zstack.header.storage.snapshot.VolumeSnapshotVO; |
24 | 23 | import org.zstack.header.storage.snapshot.reference.DeleteVolumeSnapshotReferenceLeafMsg;
|
25 | 24 | import org.zstack.header.storage.snapshot.reference.DeleteVolumeSnapshotReferenceLeafReply;
|
26 | 25 | import org.zstack.header.storage.snapshot.reference.VolumeSnapshotReferenceInventory;
|
@@ -103,7 +102,7 @@ private void deleteSnapshotRefLeaf(DeleteVolumeSnapshotReferenceLeafMsg msg, Com
|
103 | 102 | Set<String> otherLeafDirectBackingInstallUrls = msg.getOtherLeafs().stream()
|
104 | 103 | .map(VolumeSnapshotReferenceInventory::getDirectSnapshotInstallUrl)
|
105 | 104 | .collect(Collectors.toSet());
|
106 |
| - if (hasSameVolumeResource(msg.getLeaf().getDirectSnapshotInstallUrl(), otherLeafDirectBackingInstallUrls)) { |
| 105 | + if (otherLeafDirectBackingInstallUrls.contains(msg.getLeaf().getDirectSnapshotInstallUrl())) { |
107 | 106 | logger.debug(String.format("other leafs has the same direct backing, skip delete leaf: [%d]", msg.getLeaf().getId()));
|
108 | 107 | completion.success();
|
109 | 108 | return;
|
@@ -191,7 +190,7 @@ public void run(FlowTrigger trigger, Map data) {
|
191 | 190 | .filter(e -> !e.getKey().equals(startPath))
|
192 | 191 | .flatMap(e -> e.getValue().stream()).collect(Collectors.toSet());
|
193 | 192 |
|
194 |
| - filterDeletePaths(toDeletePaths, usedByOthersPaths); |
| 193 | + toDeletePaths.removeAll(usedByOthersPaths); |
195 | 194 | logger.debug("delete snapshot reference leafs: " + toDeletePaths);
|
196 | 195 | trigger.next();
|
197 | 196 | }
|
|
0 commit comments