Skip to content

Conversation

@elek
Copy link
Member

@elek elek commented Mar 4, 2019

S3 Multi-Part-Upload (MPU) is implemented recently in the Ozone s3 gateway. We have extensive testing with using 'aws s3api' application which is passed.

But it turned out that the more simple aws s3 cp command fails with 405 Media type not supported error message

The root cause of this issue is the JAXRS implementation of the multipart upload method:

{code}
@post
@produces(MediaType.APPLICATION_XML)
public Response multipartUpload(
@PathParam("bucket") String bucket,
@PathParam("path") String key,
@QueryParam("uploads") String uploads,
@QueryParam("uploadId") @DefaultValue("") String uploadID,
CompleteMultipartUploadRequest request) throws IOException, OS3Exception {
if (!uploadID.equals("")) {
//Complete Multipart upload request.
return completeMultipartUpload(bucket, key, uploadID, request);
} else {
// Initiate Multipart upload request.
return initiateMultipartUpload(bucket, key);
}
}
{code}

Here we have a CompleteMultipartUploadRequest parameter which is created by the JAXRS framework based on the media type and the request body. With Content-Type: application/xml it's easy: the JAXRS framework uses the built-in JAXB serialization. But with plain/text content-type it's not possible as there is no serialization support for CompleteMultipartUploadRequest from plain/text.

See: https://issues.apache.org/jira/browse/HDDS-1213

@elek elek added the ozone label Mar 4, 2019
@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 0 Docker mode activated.
-1 patch 6 #549 does not apply to trunk. Rebase required? Wrong Branch? See https://wiki.apache.org/hadoop/HowToContribute for help.
Subsystem Report/Notes
GITHUB PR #549
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-549/1/console
Powered by Apache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 25 Docker mode activated.
_ Prechecks _
+1 @author 0 The patch does not contain any @author tags.
-1 test4tests 0 The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
0 mvndep 67 Maven dependency ordering for branch
+1 mvninstall 1206 trunk passed
-1 compile 117 hadoop-ozone in trunk failed.
+1 checkstyle 28 trunk passed
-1 mvnsite 30 dist in trunk failed.
+1 shadedclient 870 branch has no errors when building and testing our client artifacts.
0 findbugs 0 Skipped patched modules with no Java source: hadoop-ozone/dist
+1 findbugs 41 trunk passed
+1 javadoc 39 trunk passed
_ Patch Compile Tests _
0 mvndep 13 Maven dependency ordering for patch
-1 mvninstall 20 dist in the patch failed.
-1 compile 100 hadoop-ozone in the patch failed.
-1 javac 100 hadoop-ozone in the patch failed.
+1 checkstyle 24 the patch passed
-1 mvnsite 22 dist in the patch failed.
-1 whitespace 0 The patch 5 line(s) with tabs.
+1 shadedclient 860 patch has no errors when building and testing our client artifacts.
0 findbugs 0 Skipped patched modules with no Java source: hadoop-ozone/dist
+1 findbugs 51 the patch passed
+1 javadoc 39 the patch passed
_ Other Tests _
+1 unit 40 s3gateway in the patch passed.
-1 unit 22 dist in the patch failed.
+1 asflicense 28 The patch does not generate ASF License warnings.
3808
Subsystem Report/Notes
Docker Client=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/artifact/out/Dockerfile
GITHUB PR #549
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux a01c85c47fa9 4.4.0-139-generic #165~14.04.1-Ubuntu SMP Wed Oct 31 10:55:11 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 15098df
maven version: Apache Maven 3.3.9
Default Java 1.8.0_191
compile https://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/artifact/out/branch-compile-hadoop-ozone.txt
mvnsite https://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/artifact/out/branch-mvnsite-hadoop-ozone_dist.txt
findbugs v3.1.0-RC1
mvninstall https://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/artifact/out/patch-mvninstall-hadoop-ozone_dist.txt
compile https://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/artifact/out/patch-compile-hadoop-ozone.txt
javac https://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/artifact/out/patch-compile-hadoop-ozone.txt
mvnsite https://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/artifact/out/patch-mvnsite-hadoop-ozone_dist.txt
whitespace https://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/artifact/out/whitespace-tabs.txt
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/artifact/out/patch-unit-hadoop-ozone_dist.txt
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/testReport/
Max. process+thread count 306 (vs. ulimit of 5500)
modules C: hadoop-ozone/s3gateway hadoop-ozone/dist U: hadoop-ozone
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/console
Powered by Apache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@hadoop-yetus

This comment has been minimized.

@bharatviswa504
Copy link
Contributor

bharatviswa504 commented Mar 5, 2019

Over all patch LGTM.
Thank You @elek for offline discussion.
Yes, I see that when file size is large, cp is using multipart upload request.

Few minor comments:

  1. Remove unncessary space indentation changes
  2. Removed platform.system(), as we don't need it now.

I see below error when running test manually with docker ozones3 cluster on my dev machine.

s3g_1           | 2019-03-05 22:37:40 WARN  HttpChannel:499 - //localhost:9878/b12345/mm11?partNumber=3&uploadId=d51657f3-3276-49d0-977a-af9f4bab94bc-19533321172195
s3g_1           | javax.servlet.ServletException: javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: java.lang.OutOfMemoryError: Java heap space
s3g_1           | 	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:139)
s3g_1           | 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
s3g_1           | 	at org.eclipse.jetty.server.Server.handle(Server.java:539)
s3g_1           | 	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333)
s3g_1           | 	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
s3g_1           | 	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)
s3g_1           | 	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108)
s3g_1           | 	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
s3g_1           | 	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
s3g_1           | 	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
s3g_1           | 	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
s3g_1           | 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
s3g_1           | 	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
s3g_1           | 	at java.lang.Thread.run(Thread.java:748)
s3g_1           | Caused by: javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: java.lang.OutOfMemoryError: Java heap space
s3g_1           | 	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:432)
s3g_1           | 	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:370)
s3g_1           | 	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:389)
s3g_1           | 	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:342)
s3g_1           | 	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:229)
s3g_1           | 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:840)
s3g_1           | 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1772)
s3g_1           | 	at org.apache.hadoop.http.HttpServer2$QuotingInputFilter.doFilter(HttpServer2.java:1609)
s3g_1           | 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)
s3g_1           | 	at org.apache.hadoop.http.NoCacheFilter.doFilter(NoCacheFilter.java:45)
s3g_1           | 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)
s3g_1           | 	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
s3g_1           | 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
s3g_1           | 	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
s3g_1           | 	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
s3g_1           | 	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
s3g_1           | 	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
s3g_1           | 	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
s3g_1           | 	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
s3g_1           | 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
s3g_1           | 	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
s3g_1           | 	... 13 more
s3g_1           | Caused by: org.glassfish.jersey.server.ContainerException: java.lang.OutOfMemoryError: Java heap space

I see when allocating a buffer, I am getting this error. I see by default we allocate 2 64mb buffer for all buffer lists. Any idea how to resolve this?

Run Keyword if '${system}' == 'Linux' Create Random file for linux
${result} = Execute AWSS3APICli upload-part --bucket ${BUCKET} --key multipartKey --part-number 1 --body /tmp/part1 --upload-id ${nextUploadID}
Should contain ${result} ETag
${system} = Evaluate platform.system() platform
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove line 55, as we have previously checked system type and created random file.
Now it is removed, we don't need it.

${result} = Execute AWSS3APICli upload-part --bucket ${BUCKET} --key multipartKey1 --part-number 1 --body /tmp/part1 --upload-id ${uploadID}
${eTag1} = Execute and checkrc echo '${result}' | jq -r '.ETag' 0
Should contain ${result} ETag
${system} = Evaluate platform.system() platform
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this line. Same comment as above

Should contain ${result} ETag
${result} = Execute AWSS3APICli upload-part --bucket ${BUCKET} --key multipartKey1 --part-number 2 --body /tmp/part2 --upload-id ${uploadID}
${eTag2} = Execute and checkrc echo '${result}' | jq -r '.ETag' 0
Should contain ${result} ETag
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these unintended changes? As I see the change is indentation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yetus asked me to not use tab. Without fixing the tabs the patch would cause a whitespace mismatch (my new lines with spaces and the old lines with tabs). So it's intentional, but I can move to a different

Should contain ${result} ETag
${result} = Execute AWSS3APICli upload-part --bucket ${BUCKET} --key multipartKey2 --part-number 2 --body /tmp/part2 --upload-id ${uploadID}
${eTag2} = Execute and checkrc echo '${result}' | jq -r '.ETag' 0
Should contain ${result} ETag
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove these indentation changes?

${result} = Execute AWSS3APICli upload-part --bucket ${BUCKET} --key multipartKey5 --part-number 2 --body /tmp/part2 --upload-id ${uploadID}
${eTag2} = Execute and checkrc echo '${result}' | jq -r '.ETag' 0
Should contain ${result} ETag
${system} = Evaluate platform.system() platform
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line

@elek
Copy link
Member Author

elek commented Mar 6, 2019

White space problems are reported by the yetus. I committed to a fix in a separated commit (a086953) to make it easier to review.

I removed the platform lines (9f59f5d), but to be honest, they are also independent from the patch.

So we should either accept both whitespace/platform fixes or create two new jiras for both. Just to be consistent ;-)

(As they are both committed in two separated commits they can be reverted/accepted during the merge.)

@bharatviswa504
Copy link
Contributor

Hi @elek
Thanks for the update.

White space problems are reported by the yetus. I committed to a fix in a separated commit (a086953) to make it easier to review.
I am fine with it.

But platform change is related to this patch, as previosuly we used to see check platform type and run random create file. As now you have changed it, so we don't need the check. So, that is the reason for the comments.

+1 LGTM.

@bharatviswa504
Copy link
Contributor

@elek
But any idea how to resolve the above mentioned error which is happening on my system when i run my tests?

@elek
Copy link
Member Author

elek commented Mar 6, 2019

bq. But platform change is related to this patch, as previously we used to see check platform type and run random create file.

Oh, I got it finally. You are right. I changed it to use raw bytes instead of M or m postfixes.

@hadoop-yetus

This comment has been minimized.

@vivekratnavel
Copy link
Contributor

I am hitting the same error as @bharatviswa504

@elek Please find attached the log from docker-compose

HDDS-1213.log

@elek
Copy link
Member Author

elek commented Mar 7, 2019

@vivekratnavel thanks to check it

I tried to reproduce the problem I uploaded 100MB file from my host machine with/without the patch and it worked well.

It's also working from acceptance tests both on my side and on the jenkins.

Can you please share more details? How do you run the tests? What is the os? What is your awscli/docker version. Do you have any memory limitation on the virtual host which runs docker?

Thanks

@elek
Copy link
Member Author

elek commented Mar 7, 2019

Can you please try to increase your allocated memory for the containers?

https://docs.docker.com/docker-for-mac/

@bharatviswa504
Copy link
Contributor

Thank You @elek for the info.
By increasing the docker memory settings, the tests are now passing.
+1.
I will commit this shortly.

@bharatviswa504 bharatviswa504 merged commit c072458 into apache:trunk Mar 8, 2019
shanthoosh pushed a commit to shanthoosh/hadoop that referenced this pull request Oct 15, 2019
Author: Cameron Lee <[email protected]>

Reviewers: Yi Pan <[email protected]>

Closes apache#549 from cameronlee314/sync_li_trunk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants