HDDS-10784. Multipart upload to encrypted bucket fails with ClassCastException#6618
HDDS-10784. Multipart upload to encrypted bucket fails with ClassCastException#6618adoroszlai merged 3 commits intoapache:masterfrom
Conversation
ivandika3
left a comment
There was a problem hiding this comment.
Thank you for the fix. LGTM +1.
I also saw some other explicit casting instances in ObjectEndpointStreaming:
ObjectEndpointStreaming#putKeyWithStreamObjectEndpointStreaming#copyKeyWithStreamObjectEndpointStreaming#createMultipartKey
The wrapping for createStreamKey and createMultipartStreamKey:
- OzoneDataStreamOutput
- KeyDataStreamOutput (non-secure case)
- OzoneOutputStream (secure case)
- CryptoOutputStream (FileEncryptionInfo specified)
- KeyDataStreamOutput
- OzoneOutputStream (FileEncryptionInfo not specified, but GDPR enabled)
- CipherOutputStreamOzone
- KeyDataStreamOutput
- CipherOutputStreamOzone
- CryptoOutputStream (FileEncryptionInfo specified)
I think should be fine to leave it be since these cases did not cast CryptoOutputStream to KeyMetadataAware directly. However, I think we can remove the unnecessary KeyMetadataAware casting from these methods, but I'm also fine to leave it as it is.
Another possible solution might be to extend CryptoOutputStream to support the KeyMetadataAware and delegate it to the wrapped stream, but it might entails a lot of change.
|
Thanks @ivandika3 for the review.
Thanks for pointing those out. I'll remove them as part of HDDS-10791. |
hemantk-12
left a comment
There was a problem hiding this comment.
Thanks @adoroszlai for the quick fix.
LGTM+1.
|
Thanks @hemantk-12, @ivandika3 for the review. |
…Exception (apache#6618) (cherry picked from commit a368769)
…Exception (apache#6618) (cherry picked from commit a368769)
…Exception (apache#6618) (cherry picked from commit a368769)
…Exception (apache#6618) (cherry picked from commit a368769)
…Exception (apache#6618) (cherry picked from commit a368769)
…Exception (apache#6618) (cherry picked from commit a368769)
What changes were proposed in this pull request?
Fix exception:
Steps to reproduce:
https://issues.apache.org/jira/browse/HDDS-10784
How was this patch tested?
Added acceptance test coverage for S3 with Ratis streaming disabled in encrypted bucket in
ozonesecureenvironment.ozonesecure-hacovers the same with Ratis streaming enabled.CI:
https://github.com/adoroszlai/ozone/actions/runs/8920571448