raphaelazzolini opened a new pull request, #7550: URL: https://github.com/apache/hadoop/pull/7550
This pull-request is a cherry-pick of https://github.com/apache/hadoop/pull/7396 into branch-3.4 Add the property fs.s3a.checksum.algorithm that allow users to specify a checksum algorithm (CRC32, CRC32C, SHA1, or SHA256) to be used by the AWS SDK to generate the checksum for object integrity check. Contributed by Raphael Azzolini ### Description of PR This code change adds a new property to S3A: `fs.s3a.checksum.algorithm`. This property accepts the values `CRC32`, `CRC32C`, `SHA1`, and `SHA256`, that will be passed to the `checksumAlgorithm` parameter from `PutObject`, `CopyObjectRequest`, `CreateMultipartUploadRequest`, and `UploadPartRequest` to tell the AWS SDK to generate a checksum for the file to be uploaded. ### How was this patch tested? Tested in us-west-1. Both integration tests executed with and without `fs.s3a.checksum.algorithm` have the same failures: ``` [ERROR] Errors: [ERROR] ITestS3ACannedACLs>AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AWSBadRequest [ERROR] ITestRoleDelegationInFilesystem.setup:40->ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestRoleDelegationInFilesystem.setup:40->ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestRoleDelegationInFilesystem.setup:40->ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestRoleDelegationInFilesystem.setup:40->ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestRoleDelegationInFilesystem.setup:40->ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestRoleDelegationInFilesystem.setup:40->ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestRoleDelegationInFilesystem.setup:40->ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestRoleDelegationInFilesystem.setup:40->ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestRoleDelegationInFilesystem.setup:40->ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestRoleDelegationInFilesystem.setup:40->ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestRoleDelegationInFilesystem.setup:40->ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [ERROR] ITestSessionDelegationInFilesystem.setup:209->AbstractS3ATestBase.setup:106->AbstractFSContractTestBase.setup:205->AbstractFSContractTestBase.mkdirs:363 » AccessDenied [INFO] [ERROR] Tests run: 1261, Failures: 0, Errors: 23, Skipped: 171 ``` I changed `ITestCustomSigner` to unset `fs.s3a.checksum.algorithm` because it fails due to missing x-amz-checksum-* or x-amz-trailer headers when calling `fs.mkdirs(finalPath)`. It looks like the SDK doesn't generate the checksum when using the custom signer, and I couldn't find how to make it create it. ``` [ERROR] Run 1: PUT 0-byte object on job-00/test/testCustomSignerAndInitializer[bulk delete]/customsignerpath1: software.amazon.awssdk.services.s3.model.S3Exception: x-amz-sdk-checksum-algorithm specified, but no corresponding x-amz-checksum-* or x-amz-trailer headers were found. (Service: S3, Status Code: 400, Request ID: R01A1MJX3EF6K1TD, Extended Request ID: w/HTRsL9mlToigMlk+n4dI+kyhoTMKlLLjlUyYYmMyFixn/DeJL2QAzcq7lqUEQn+TupwkEmrhI=):InvalidRequest: x-amz-sdk-checksum-algorithm specified, but no corresponding x-amz-checksum-* or x-amz-trailer headers were found. (Service: S3, Status Code: 400, Request ID: R01A1MJX3EF6K1TD, Extended Request ID: w/HTRsL9mlToigMlk+n4dI+kyhoTMKlLLjlUyYYmMyFixn/DeJL2QAzcq7lqUEQn+TupwkEmrhI=) ``` #### Scale Tests I executed the scale tests with different file sizes to investigate how much the checksum generation affects the performance. By the time that it took to complete the tests, it doesn't seem that it impacts the performance very much. The difference was noticeable when I used `-Dfs.s3a.scale.test.huge.filesize=10G`. Tests results can be seen in the file from the link below: [HADOOP-15224 Tests.md](https://github.com/user-attachments/files/18820781/HADOOP-15224.Tests.md) ### For code changes: - [X] Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')? - [X] Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation? - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, `NOTICE-binary` files? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org