From 2841666f1f2dec96761a0aa34a69cbb20297aa14 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Tue, 21 Mar 2017 13:15:15 +0000 Subject: [PATCH] HADOOP-14204 S3A multipart commit failing, "UnsupportedOperationException at java.util.Collections$UnmodifiableList.sort". Contributed by Steve Loughran (cherry picked from commit 595501c9ddacd5fdb740ac1bf9bfeb0ffbbd6c0e) --- .../src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java index e0ff5a884b..6c8941253e 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java @@ -2403,11 +2403,13 @@ CompleteMultipartUploadResult completeMultipartUpload(String uploadId, "No partitions have been uploaded"); LOG.debug("Completing multipart upload {} with {} parts", uploadId, partETags.size()); + // a copy of the list is required, so that the AWS SDK doesn't + // attempt to sort an unmodifiable list. return s3.completeMultipartUpload( new CompleteMultipartUploadRequest(bucket, key, uploadId, - partETags)); + new ArrayList<>(partETags))); } /**