From 28d71f34269044a792537d52c412945391ed21df Mon Sep 17 00:00:00 2001 From: zhiheng xie Date: Thu, 12 Dec 2024 18:48:32 -0800 Subject: [PATCH] fix test error --- .../s3/multipart/S3MultipartUploadAbortRequest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3MultipartUploadAbortRequest.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3MultipartUploadAbortRequest.java index 61a6c4ff237a..38910950328a 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3MultipartUploadAbortRequest.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3MultipartUploadAbortRequest.java @@ -157,13 +157,18 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, TermIn // If there is no entry in openKeyTable, then there is no multipart // upload initiated for this key. if (omKeyInfo == null) { - throw new OMException("Abort Multipart Upload Failed: volume: " + + throw new OMException("Abort Multipart Upload Failed (omKeyInfo not found): volume: " + requestedVolume + "bucket: " + requestedBucket + "key: " + keyName, OMException.ResultCodes.NO_SUCH_MULTIPART_UPLOAD_ERROR); } multipartKeyInfo = omMetadataManager.getMultipartInfoTable() .get(multipartKey); + if (multipartKeyInfo == null) { + throw new OMException("Abort Multipart Upload Failed (multipartKeyInfo not found): volume: " + + requestedVolume + "bucket: " + requestedBucket + "key: " + keyName, + OMException.ResultCodes.NO_SUCH_MULTIPART_UPLOAD_ERROR); + } multipartKeyInfo.setUpdateID(trxnLogIndex, ozoneManager.isRatisEnabled()); // When abort uploaded key, we need to subtract the PartKey length from