Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-11784. Allow aborting FSO multipart uploads with missing parent directories #7700

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 4 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 @@ -85,7 +85,6 @@
import org.apache.hadoop.ozone.om.lock.OzoneManagerLock;
import org.apache.hadoop.hdds.utils.TransactionInfo;
import org.apache.hadoop.ozone.om.protocolPB.OzoneManagerProtocolClientSideTranslatorPB;
import org.apache.hadoop.ozone.om.request.file.OMFileRequest;
import org.apache.hadoop.ozone.om.request.util.OMMultipartUploadUtils;
import org.apache.hadoop.ozone.om.snapshot.ReferenceCounted;
import org.apache.hadoop.ozone.om.snapshot.SnapshotUtils;
Expand Down Expand Up @@ -899,11 +898,13 @@ public String getMultipartKeyFSO(String volume, String bucket, String key, Strin
final long volumeId = getVolumeId(volume);
final long bucketId = getBucketId(volume,
bucket);
long parentId =
OMFileRequest.getParentID(volumeId, bucketId, key, this);

String fileName = OzoneFSUtils.getFileName(key);
final String nonFSOMultipartKey =
getMultipartKey(volume, bucket, key, uploadId);
ivandika3 marked this conversation as resolved.
Show resolved Hide resolved
final OmMultipartKeyInfo multipartKeyInfo =
getMultipartInfoTable().get(nonFSOMultipartKey);
ivandika3 marked this conversation as resolved.
Show resolved Hide resolved
final long parentId = multipartKeyInfo.getParentID();

final String fileName = OzoneFSUtils.getFileName(key);
return getMultipartKey(volumeId, bucketId, parentId,
fileName, uploadId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.FILE_TABLE;
import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.MULTIPARTINFO_TABLE;
import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.OPEN_FILE_TABLE;
import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.DIRECTORY_TABLE;

/**
* Response for Multipart Upload Complete request.
Expand All @@ -47,7 +48,7 @@
* 3) Delete unused parts.
*/
@CleanupTableInfo(cleanupTables = {OPEN_FILE_TABLE, FILE_TABLE, DELETED_TABLE,
MULTIPARTINFO_TABLE})
MULTIPARTINFO_TABLE, DIRECTORY_TABLE})
public class S3MultipartUploadCompleteResponseWithFSO
extends S3MultipartUploadCompleteResponse {

Expand Down
Loading