HDDS-6349. IncompleteReadError on get MPU key from TDE bucket#3116
HDDS-6349. IncompleteReadError on get MPU key from TDE bucket#3116adoroszlai merged 7 commits intoapache:masterfrom
Conversation
|
cc @kerneltime for review. |
|
Thanks @adoroszlai for fixing this. I have a minor suggestion. The acceptance test looks great. Can we also add a check in the integration test It would be good if this test also checked reading the file consecutively without reseting position. If not this, at least a check for verifying position would be good to have. |
|
Thanks @hanishakoneru for the review and the pointer to while same test on |
hanishakoneru
left a comment
There was a problem hiding this comment.
Thanks @adoroszlai. LGTM. +1 for merge.
|
Thanks @hanishakoneru for the review. |
What changes were proposed in this pull request?
MultipartCryptoKeyInputStreammay need to adjust read position and/or length to make sure it reads enough data to fill the crypto buffer. Position adjustment means read starts at a location before the actual requested position. Length adjustment means more data is read at the end. Extra data is discarded in both cases.This PR fixes a bug in length adjustment: the position of the underlying stream was left at the position after the discarded part, this is where the next read started. Thus this part was missing from the final data at the client side.
The bug can be reproduced with MPU parts that are not whole multiples of the crypto buffer size, which defaults to 8KB. Hence test case is added where the first part has 1KB more, to trigger length adjustment in the second part.
The PR also adds the KMS configs necessary to test S3 Gateway with encrypted bucket, and runs all S3 tests with encrypted bucket, too (in non-HA case for now).
https://issues.apache.org/jira/browse/HDDS-6349
How was this patch tested?
Added Robot test to reproduce the problem:
https://github.com/adoroszlai/hadoop-ozone/runs/5263846303#step:5:528
And verified the fix:
https://github.com/adoroszlai/hadoop-ozone/runs/5265040205#step:5:524