Skip to content

HDDS-1213. Support plain text S3 MPU initialization request - #549

Merged
bharatviswa504 merged 4 commits into
apache:trunkfrom
elek:HDDS-1213
Mar 8, 2019
Merged

HDDS-1213. Support plain text S3 MPU initialization request#549
bharatviswa504 merged 4 commits into
apache:trunkfrom
elek:HDDS-1213

Conversation

@elek

@elekelek commented Mar 4, 2019

Copy link
Copy Markdown
Member

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

@elekelek added the ozone label Mar 4, 2019
@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec0Docker mode activated.
-1patch6#549 does not apply to trunk. Rebase required? Wrong Branch? See https://wiki.apache.org/hadoop/HowToContribute for help.
SubsystemReport/Notes
GITHUB PR#549
Console outputhttps://builds.apache.org/job/hadoop-multibranch/job/PR-549/1/console
Powered byApache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

Comment threadhadoop-ozone/dist/src/main/smoketest/s3/MultipartUpload.robot Outdated
Comment threadhadoop-ozone/dist/src/main/smoketest/s3/MultipartUpload.robot Outdated
Comment threadhadoop-ozone/dist/src/main/smoketest/s3/MultipartUpload.robot Outdated
Comment threadhadoop-ozone/dist/src/main/smoketest/s3/MultipartUpload.robot Outdated
Comment threadhadoop-ozone/dist/src/main/smoketest/s3/MultipartUpload.robot Outdated
@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec25Docker mode activated.
_ Prechecks _
+1@author0The patch does not contain any @author tags.
-1test4tests0The 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 _
0mvndep67Maven dependency ordering for branch
+1mvninstall1206trunk passed
-1compile117hadoop-ozone in trunk failed.
+1checkstyle28trunk passed
-1mvnsite30dist in trunk failed.
+1shadedclient870branch has no errors when building and testing our client artifacts.
0findbugs0Skipped patched modules with no Java source: hadoop-ozone/dist
+1findbugs41trunk passed
+1javadoc39trunk passed
_ Patch Compile Tests _
0mvndep13Maven dependency ordering for patch
-1mvninstall20dist in the patch failed.
-1compile100hadoop-ozone in the patch failed.
-1javac100hadoop-ozone in the patch failed.
+1checkstyle24the patch passed
-1mvnsite22dist in the patch failed.
-1whitespace0The patch 5 line(s) with tabs.
+1shadedclient860patch has no errors when building and testing our client artifacts.
0findbugs0Skipped patched modules with no Java source: hadoop-ozone/dist
+1findbugs51the patch passed
+1javadoc39the patch passed
_ Other Tests _
+1unit40s3gateway in the patch passed.
-1unit22dist in the patch failed.
+1asflicense28The patch does not generate ASF License warnings.
3808
SubsystemReport/Notes
DockerClient=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 Testsdupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
unameLinux 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 toolmaven
Personalitypersonality/hadoop.sh
git revisiontrunk / 15098df
mavenversion: Apache Maven 3.3.9
Default Java1.8.0_191
compilehttps://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/artifact/out/branch-compile-hadoop-ozone.txt
mvnsitehttps://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/artifact/out/branch-mvnsite-hadoop-ozone_dist.txt
findbugsv3.1.0-RC1
mvninstallhttps://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/artifact/out/patch-mvninstall-hadoop-ozone_dist.txt
compilehttps://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/artifact/out/patch-compile-hadoop-ozone.txt
javachttps://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/artifact/out/patch-compile-hadoop-ozone.txt
mvnsitehttps://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/artifact/out/patch-mvnsite-hadoop-ozone_dist.txt
whitespacehttps://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/artifact/out/whitespace-tabs.txt
unithttps://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/artifact/out/patch-unit-hadoop-ozone_dist.txt
Test Resultshttps://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/testReport/
Max. process+thread count306 (vs. ulimit of 5500)
modulesC: hadoop-ozone/s3gateway hadoop-ozone/dist U: hadoop-ozone
Console outputhttps://builds.apache.org/job/hadoop-multibranch/job/PR-549/2/console
Powered byApache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@hadoop-yetus

This comment has been minimized.

@bharatviswa504

bharatviswa504 commented Mar 5, 2019

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Copy Markdown
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
Copy Markdown
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

elek commented Mar 6, 2019

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
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
Copy Markdown
Contributor

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

@elek

elek commented Mar 6, 2019

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
Contributor

I am hitting the same error as @bharatviswa504

@elek Please find attached the log from docker-compose

HDDS-1213.log

@elek

elek commented Mar 7, 2019

Copy link
Copy Markdown
MemberAuthor

@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

elek commented Mar 7, 2019

Copy link
Copy Markdown
MemberAuthor

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

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

@bharatviswa504

Copy link
Copy Markdown
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:trunkMar 8, 2019
shanthoosh pushed a commit to shanthoosh/hadoop that referenced this pull request Oct 15, 2019
Author: Cameron Lee <calee@linkedin.com>
Reviewers: Yi Pan <nickpan47@gmail.com>
Closesapache#549 from cameronlee314/sync_li_trunk
Sign up for freeto 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

@elek@hadoop-yetus@bharatviswa504@vivekratnavel