Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import static org.apache.hadoop.fs.FileSystem.FS_DEFAULT_NAME_KEY;
import static org.apache.hadoop.hdds.scm.net.NetConstants.PATH_SEPARATOR_STR;
import static org.apache.hadoop.ozone.OFSPath.OFS_MOUNT_TMP_VOLUMENAME;
import static org.apache.hadoop.ozone.OzoneConsts.OZONE_OFS_URI_SCHEME;
import static org.apache.hadoop.ozone.om.helpers.BucketLayout.OBJECT_STORE;

Expand Down Expand Up @@ -83,7 +84,7 @@ protected void execute(OzoneClient client, OzoneAddress address)
}
}
OzoneBucket bucket = vol.getBucket(bucketName);
if (bucket.getBucketLayout().equals(OBJECT_STORE)) {
if (bucket.getBucketLayout().equals(OBJECT_STORE) || vol.getName().equals(OFS_MOUNT_TMP_VOLUMENAME)) {
deleteOBSBucketRecursive(vol, bucket);
} else {
deleteFSBucketRecursive(vol, bucket);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import static org.apache.hadoop.fs.FileSystem.FS_DEFAULT_NAME_KEY;
import static org.apache.hadoop.hdds.scm.net.NetConstants.PATH_SEPARATOR_STR;
import static org.apache.hadoop.ozone.OFSPath.OFS_MOUNT_TMP_VOLUMENAME;
import static org.apache.hadoop.ozone.OzoneConsts.OZONE_OFS_URI_SCHEME;

import java.io.IOException;
Expand Down Expand Up @@ -195,8 +196,14 @@ public void run() {
switch (bucket.getBucketLayout()) {
case FILE_SYSTEM_OPTIMIZED:
case LEGACY:
if (!cleanFSBucket(bucket)) {
throw new RuntimeException("Failed to clean bucket");
if (vol.getName().equals(OFS_MOUNT_TMP_VOLUMENAME)) {
if (!cleanOBSBucket(bucket)) {
throw new RuntimeException("Failed to clean bucket");
}
} else {
if (!cleanFSBucket(bucket)) {
throw new RuntimeException("Failed to clean bucket");
}
}
break;
case OBJECT_STORE:
Expand Down