diff --git a/pom.xml b/pom.xml
index a051471e..b11c1396 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
com.qcloud.cos
hadoop-cos
- 8.0.4
+ 8.0.5
jar
Apache Hadoop Tencent Qcloud COS Support
@@ -41,7 +41,7 @@
1.7
1.7
3.3.0
- 5.6.68
+ 5.6.69
24.1.1-jre
3.1
4.8
diff --git a/src/main/java/org/apache/hadoop/fs/CosNConfigKeys.java b/src/main/java/org/apache/hadoop/fs/CosNConfigKeys.java
index 5533483b..18d99844 100644
--- a/src/main/java/org/apache/hadoop/fs/CosNConfigKeys.java
+++ b/src/main/java/org/apache/hadoop/fs/CosNConfigKeys.java
@@ -12,7 +12,7 @@
@InterfaceStability.Unstable
public class CosNConfigKeys extends CommonConfigurationKeys {
public static final String USER_AGENT = "fs.cosn.user.agent";
- public static final String DEFAULT_USER_AGENT = "cos-hadoop-plugin-v8.0.4";
+ public static final String DEFAULT_USER_AGENT = "cos-hadoop-plugin-v8.0.5";
public static final String TENCENT_EMR_VERSION_KEY = "fs.emr.version";
diff --git a/src/main/java/org/apache/hadoop/fs/CosNativeFileSystemStore.java b/src/main/java/org/apache/hadoop/fs/CosNativeFileSystemStore.java
index 9fc152da..7a02a33d 100644
--- a/src/main/java/org/apache/hadoop/fs/CosNativeFileSystemStore.java
+++ b/src/main/java/org/apache/hadoop/fs/CosNativeFileSystemStore.java
@@ -1374,6 +1374,26 @@ private Object callCOSClientWithRetry(X request) throws CosServiceException,
LOG.error(errMsg, cse);
throw new IOException(errMsg);
}
+ } else if (request instanceof CompleteMultipartUploadRequest && statusCode / 100 ==2
+ && errorCode != null && !errorCode.isEmpty()) {
+ // complete mpu error code might be in body when status code is 200
+ // double check to head object only works in big data job case which key is not same.
+ String key = ((CompleteMultipartUploadRequest) request).getKey();
+ FileMetadata fileMetadata = this.queryObjectMetadata(key);
+ if (null != fileMetadata) {
+ // if file exist direct return.
+ LOG.info("complete mpu error in body, error code {}, but key {} already exist, length {}",
+ errorCode, key, fileMetadata.getLength());
+ return new CompleteMultipartUploadResult();
+ }
+ // here same like the copy request not setting the interval sleep for now
+ if (retryIndex <= this.maxRetryTimes) {
+ LOG.info(errMsg, cse);
+ ++retryIndex;
+ } else {
+ LOG.error(errMsg, cse);
+ throw new IOException(errMsg);
+ }
} else if (statusCode / 100 == 5) {
if (retryIndex <= this.maxRetryTimes) {
LOG.info(errMsg, cse);