Skip to content

HDDS-1948. S3 MPU can't be created with octet-stream content-type #1266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 23, 2019

Conversation

elek
Copy link
Member

@elek elek commented Aug 10, 2019

This problem is reported offline by [~shanekumpf@gmail.com].

When aws-sdk-go is used to access to s3 gateway of Ozone it sends the Multi Part Upload initialize message with "application/octet-stream" Content-Type.

This Content-Type is missing from the aws-cli which is used to reimplement s3 endpoint.

The problem is that we use the same rest endpoint for initialize and complete Multipart Upload request. For the completion we need the CompleteMultipartUploadRequest parameter which is parsed from the body.

For initialize we have an empty body which can't be serialized to CompleteMultipartUploadRequest.

The workaround is to set a specific content type from a filter which help up to create two different REST method for initialize and completion message.

Here is an example to test (using bogus AWS credentials).

{code}
curl -H 'Host:yourhost' -H 'User-Agent:aws-sdk-go/1.15.11 (go1.11.2; linux; amd64)' -H 'Content-Length:0' -H 'Authorization:AWS4-HMAC-SHA256 Credential=qwe/20190809/ozone/s3/aws4_request, SignedHeaders=content-type;host;x-amz-acl;x-amz-content-sha256;x-amz-date;x-amz-storage-class, Signature=7726ed63990ba3f4f1f796d4ab263f5d9c3374528840f5e49d106dbef491f22c' -H 'Content-Type:application/octet-stream' -H 'X-Amz-Acl:private' -H 'X-Amz-Content-Sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' -H 'X-Amz-Date:20190809T070142Z' -H 'X-Amz-Storage-Class:STANDARD' -H 'Accept-Encoding:gzip' -X POST 'http://localhost:9999/docker/docker/registry/v2/repositories/apache/ozone-runner/_uploads/2173f019-09c3-466b-bb7d-c31ce749d826/data?uploads
{code}

Without the patch it returns with HTTP 405 (Not supported Media Type).

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

@elek elek added the ozone label Aug 10, 2019
@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 42 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 5 new or modified test files.
_ trunk Compile Tests _
+1 mvninstall 593 trunk passed
+1 compile 375 trunk passed
+1 checkstyle 76 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 868 branch has no errors when building and testing our client artifacts.
+1 javadoc 170 trunk passed
0 spotbugs 423 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 620 trunk passed
_ Patch Compile Tests _
+1 mvninstall 551 the patch passed
+1 compile 376 the patch passed
+1 javac 376 the patch passed
+1 checkstyle 84 the patch passed
+1 mvnsite 0 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedclient 674 patch has no errors when building and testing our client artifacts.
+1 javadoc 168 the patch passed
+1 findbugs 632 the patch passed
_ Other Tests _
-1 unit 296 hadoop-hdds in the patch failed.
-1 unit 1766 hadoop-ozone in the patch failed.
+1 asflicense 56 The patch does not generate ASF License warnings.
7525
Reason Tests
Failed junit tests hadoop.hdds.scm.safemode.TestSCMSafeModeManager
hadoop.ozone.client.rpc.TestOzoneRpcClient
hadoop.ozone.client.rpc.TestSecureOzoneRpcClient
hadoop.ozone.client.rpc.TestMultiBlockWritesWithDnFailures
hadoop.ozone.client.rpc.TestOzoneAtRestEncryption
hadoop.hdds.scm.pipeline.TestRatisPipelineProvider
hadoop.ozone.client.rpc.TestBlockOutputStreamWithFailures
Subsystem Report/Notes
Docker Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1266/1/artifact/out/Dockerfile
GITHUB PR #1266
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux be2ffc260e5d 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / fba222a
Default Java 1.8.0_212
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-1266/1/artifact/out/patch-unit-hadoop-hdds.txt
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-1266/1/artifact/out/patch-unit-hadoop-ozone.txt
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1266/1/testReport/
Max. process+thread count 4900 (vs. ulimit of 5500)
modules C: hadoop-ozone/s3gateway U: hadoop-ozone/s3gateway
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1266/1/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

Copy link
Contributor

@bharatviswa504 bharatviswa504 left a comment

Choose a reason for hiding this comment

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

Overall LGTM.
One minor comment.
Some of the S3 tests are failing, can you verify if they are related, as failed tests are related to S3 MPU.

@elek
Copy link
Member Author

elek commented Aug 21, 2019

bq. Some of the S3 tests are failing, can you verify if they are related, as failed tests are related to S3 MPU.

I tested locally and worked well. Let's wait for an other jenkins result...

@apache apache deleted a comment from hadoop-yetus Aug 21, 2019
@apache apache deleted a comment from hadoop-yetus Aug 21, 2019
@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 120 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 5 new or modified test files.
_ trunk Compile Tests _
+1 mvninstall 744 trunk passed
+1 compile 438 trunk passed
+1 checkstyle 84 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 1098 branch has no errors when building and testing our client artifacts.
+1 javadoc 208 trunk passed
0 spotbugs 518 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 772 trunk passed
_ Patch Compile Tests _
+1 mvninstall 678 the patch passed
+1 compile 453 the patch passed
+1 javac 453 the patch passed
+1 checkstyle 94 the patch passed
+1 mvnsite 0 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedclient 805 patch has no errors when building and testing our client artifacts.
+1 javadoc 164 the patch passed
+1 findbugs 688 the patch passed
_ Other Tests _
+1 unit 361 hadoop-hdds in the patch passed.
-1 unit 2309 hadoop-ozone in the patch failed.
+1 asflicense 41 The patch does not generate ASF License warnings.
9245
Reason Tests
Failed junit tests hadoop.ozone.client.rpc.TestReadRetries
hadoop.ozone.TestMiniOzoneCluster
hadoop.ozone.client.rpc.TestSecureOzoneRpcClient
hadoop.ozone.client.rpc.TestContainerStateMachine
hadoop.hdds.scm.pipeline.TestRatisPipelineCreateAndDestory
hadoop.ozone.container.server.TestSecureContainerServer
hadoop.ozone.client.rpc.TestOzoneAtRestEncryption
Subsystem Report/Notes
Docker Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1266/4/artifact/out/Dockerfile
GITHUB PR #1266
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux 2a330f2e5a5b 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 10ec31d
Default Java 1.8.0_212
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-1266/4/artifact/out/patch-unit-hadoop-ozone.txt
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1266/4/testReport/
Max. process+thread count 5344 (vs. ulimit of 5500)
modules C: hadoop-ozone/s3gateway U: hadoop-ozone/s3gateway
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1266/4/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 77 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 5 new or modified test files.
_ trunk Compile Tests _
+1 mvninstall 672 trunk passed
+1 compile 464 trunk passed
+1 checkstyle 95 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 1101 branch has no errors when building and testing our client artifacts.
+1 javadoc 206 trunk passed
0 spotbugs 516 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 760 trunk passed
_ Patch Compile Tests _
+1 mvninstall 688 the patch passed
+1 compile 447 the patch passed
+1 javac 447 the patch passed
+1 checkstyle 97 the patch passed
+1 mvnsite 0 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedclient 872 patch has no errors when building and testing our client artifacts.
+1 javadoc 210 the patch passed
+1 findbugs 835 the patch passed
_ Other Tests _
-1 unit 406 hadoop-hdds in the patch failed.
-1 unit 2257 hadoop-ozone in the patch failed.
+1 asflicense 42 The patch does not generate ASF License warnings.
9412
Reason Tests
Failed junit tests hadoop.hdds.scm.block.TestBlockManager
hadoop.hdds.scm.pipeline.TestSCMPipelineManager
hadoop.ozone.client.rpc.TestContainerStateMachineFailures
hadoop.ozone.client.rpc.TestBlockOutputStreamWithFailures
hadoop.ozone.client.rpc.TestOzoneRpcClientForAclAuditLog
hadoop.ozone.container.server.TestSecureContainerServer
hadoop.ozone.client.rpc.TestFailureHandlingByClient
hadoop.hdds.scm.pipeline.TestRatisPipelineCreateAndDestory
hadoop.ozone.client.rpc.Test2WayCommitInRatis
hadoop.ozone.client.rpc.TestWatchForCommit
Subsystem Report/Notes
Docker Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1266/5/artifact/out/Dockerfile
GITHUB PR #1266
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux 1724feeb2378 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / ee7c261
Default Java 1.8.0_222
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-1266/5/artifact/out/patch-unit-hadoop-hdds.txt
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-1266/5/artifact/out/patch-unit-hadoop-ozone.txt
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1266/5/testReport/
Max. process+thread count 4803 (vs. ulimit of 5500)
modules C: hadoop-ozone/s3gateway U: hadoop-ozone/s3gateway
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1266/5/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

Copy link
Contributor

@bharatviswa504 bharatviswa504 left a comment

Choose a reason for hiding this comment

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

+1 LGTM.
Thank You @elek for the fix.
I will commit this to the trunk.

@bharatviswa504 bharatviswa504 merged commit edd7085 into apache:trunk Aug 23, 2019
asfgit pushed a commit that referenced this pull request Aug 23, 2019
amahussein pushed a commit to amahussein/hadoop that referenced this pull request Oct 29, 2019
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.

3 participants