|
@@ -6961,6 +6961,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
return; // Return previous response
|
|
|
}
|
|
|
boolean success = false;
|
|
|
+ BlocksMapUpdateInfo collectedBlocks = new BlocksMapUpdateInfo();
|
|
|
writeLock();
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
@@ -6969,7 +6970,6 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
checkOwner(pc, snapshotRoot);
|
|
|
}
|
|
|
|
|
|
- BlocksMapUpdateInfo collectedBlocks = new BlocksMapUpdateInfo();
|
|
|
List<INode> removedINodes = new ChunkedArrayList<INode>();
|
|
|
dir.writeLock();
|
|
|
try {
|
|
@@ -6980,8 +6980,6 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
dir.writeUnlock();
|
|
|
}
|
|
|
removedINodes.clear();
|
|
|
- this.removeBlocks(collectedBlocks);
|
|
|
- collectedBlocks.clear();
|
|
|
getEditLog().logDeleteSnapshot(snapshotRoot, snapshotName,
|
|
|
cacheEntry != null);
|
|
|
success = true;
|
|
@@ -6990,7 +6988,10 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
RetryCache.setState(cacheEntry, success);
|
|
|
}
|
|
|
getEditLog().logSync();
|
|
|
-
|
|
|
+
|
|
|
+ removeBlocks(collectedBlocks);
|
|
|
+ collectedBlocks.clear();
|
|
|
+
|
|
|
if (auditLog.isInfoEnabled() && isExternalInvocation()) {
|
|
|
String rootPath = Snapshot.getSnapshotPath(snapshotRoot, snapshotName);
|
|
|
logAuditEvent(true, "deleteSnapshot", rootPath, null, null);
|