[
https://issues.apache.org/jira/browse/HADOOP-15224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17927829#comment-17927829
]
ASF GitHub Bot commented on HADOOP-15224:
-----------------------------------------
raphaelazzolini opened a new pull request, #7396:
URL: https://github.com/apache/hadoop/pull/7396
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?
> builld up md5 checksum as blocks are built in S3ABlockOutputStream; validate
> upload
> -----------------------------------------------------------------------------------
>
> Key: HADOOP-15224
> URL: https://issues.apache.org/jira/browse/HADOOP-15224
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs/s3
> Affects Versions: 3.0.0
> Reporter: Steve Loughran
> Assignee: Raphael Azzolini
> Priority: Minor
> Labels: pull-request-available
>
> [~rdblue] reports sometimes he sees corrupt data on S3. Given MD5 checks from
> upload to S3, its likelier to have happened in VM RAM, HDD or nearby.
> If the MD5 checksum for each block was built up as data was written to it,
> and checked against the etag RAM/HDD storage of the saved blocks could be
> removed as sources of corruption
> The obvious place would be
> {{org.apache.hadoop.fs.s3a.S3ADataBlocks.DataBlock}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]