HDDS-10570. S3A: fs -touch creates directory instead of empty file in FSO bucket#6452
Conversation
|
@mladjan-gadzic please take a look if you have time |
|
@ivandika3 @SaketaChalamchala can you please review? |
@adoroszlai, thanks for working on this. Looks like an oversight in HDDS-7594 is fixed here. I'd just like to confirm one thing. Is it possible to receive put request for dir creation without trailing slash? |
I recall the spec being a bit unclear here when we did HDDS-7594. I can't think of another system that has a client and server that each support directories and allows them to communicate through a protocol that does not support directory creation. If the spec is that an object must be empty and end in a slash to be considered a directory when passing through the client and server S3 layers then this change makes sense. I guess the way to verify this is correct is to check the s3a code and verify that it always translates |
|
Thanks @errose28, @mladjan-gadzic for the quick response. I plan to add S3A's implementation of Hadoop contract tests to CI in HDDS-8450, but it's not yet ready. HDDS-10572 is required for speeding up the tests (maybe even fixing some). Until then, some partial results with the patch: On current Also tried some other tests that pass both with and without the patch: All results above are for FSO bucket. These tests (including |
errose28
left a comment
There was a problem hiding this comment.
Thanks for fixing this @adoroszlai. Having the s3a contract tests run against Ozone to check these cases will be a great improvement in the future as well.
|
Thanks @errose28, @mladjan-gadzic for the review.
All requests in |
…in FSO bucket (apache#6452) (cherry picked from commit 85c9c97)
…in FSO bucket (apache#6452) (cherry picked from commit 85c9c97)
What changes were proposed in this pull request?
Fix a bug where attempting to create empty file in FSO bucket via S3 Gateway results in creation of a directory.
The same works OK in
OBJECT_STOREandLEGACYbuckets.It was broken by HDDS-7594, which fixed a bug where attempt to create directory through S3G created files instead. In other words, prior behavior was also wrong, just the other way around.
https://issues.apache.org/jira/browse/HDDS-10570
How was this patch tested?
Added test case in unit test (
TestObjectPut).Changed acceptance tests to run tests on all three bucket layout types.
Also tested manually:
CI:
https://github.com/adoroszlai/ozone/actions/runs/8456929496