spacemonkd commented on code in PR #10588:
URL: https://github.com/apache/ozone/pull/10588#discussion_r3534483292
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/s3/multipart/AbstractS3MultipartAbortResponse.java:
##########
@@ -74,24 +75,34 @@ protected void addAbortToBatch(
OmMultipartKeyInfo omMultipartKeyInfo = abortInfo
.getOmMultipartKeyInfo();
- // Move all the parts to delete table
- for (PartKeyInfo partKeyInfo: omMultipartKeyInfo.getPartKeyInfoMap()) {
- OmKeyInfo currentKeyPartInfo =
- OmKeyInfo.getFromProtobuf(partKeyInfo.getPartKeyInfo());
+ if (omMultipartKeyInfo.getSchemaVersion()
+ == OmMultipartKeyInfo.LEGACY_SCHEMA_VERSION) {
+ // Move all the parts to delete table
+ for (PartKeyInfo partKeyInfo: omMultipartKeyInfo.getPartKeyInfoMap()) {
+ OmKeyInfo currentKeyPartInfo =
+ OmKeyInfo.getFromProtobuf(partKeyInfo.getPartKeyInfo());
- // TODO: Similar to open key deletion response, we can check if the
- // MPU part actually contains blocks, and only move the to
- // deletedTable if it does.
+ // TODO: Similar to open key deletion response, we can check if the
+ // MPU part actually contains blocks, and only move the to
+ // deletedTable if it does.
- RepeatedOmKeyInfo repeatedOmKeyInfo =
OmUtils.prepareKeyForDelete(omBucketInfo.getObjectID(),
- currentKeyPartInfo, omMultipartKeyInfo.getUpdateID());
+ addPartToDeletedTable(omMetadataManager, batchOperation,
+ omBucketInfo, abortInfo, currentKeyPartInfo,
+ omMultipartKeyInfo.getUpdateID());
+ }
+ } else {
+ for (OmKeyInfo currentKeyPartInfo :
+ abortInfo.getPartsKeyInfoToDelete()) {
+ addPartToDeletedTable(omMetadataManager, batchOperation,
+ omBucketInfo, abortInfo, currentKeyPartInfo,
+ omMultipartKeyInfo.getUpdateID());
+ }
- // multi-part key format is volumeName/bucketName/keyName/uploadId
- String deleteKey = omMetadataManager.getOzoneDeletePathKey(
- currentKeyPartInfo.getObjectID(), abortInfo.getMultipartKey());
-
- omMetadataManager.getDeletedTable().putWithBatch(batchOperation,
- deleteKey, repeatedOmKeyInfo);
+ for (OmMultipartPartKey partKey :
+ abortInfo.getPartsTableKeysToDelete()) {
+ omMetadataManager.getMultipartPartsTable().deleteWithBatch(
+ batchOperation, partKey);
+ }
Review Comment:
Yes this is planned as part of the future work for MPU optimizations. It has
been advised in the design document as well that we can use DeleteRange in
future.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]