Repository navigation
esti: test lakectl fs upload of files over 5GiB - #10478
Conversation
Covers the multipart path fixed in treeverse#9283 for both pre-signed and regular uploads. Extends the output sanitizers to handle multipart etags (md5-N) and relative physical addresses with part suffixes. Closes treeverse#9284
|
hi @itaiad200, just checking in on this one |
I think you meant to tag @itaigilo |
itaigilo
left a comment
There was a problem hiding this comment.
Thanks @highlyavailable for your contribution!
These tests indeed add to the robustness of lakeFS, which is great.
However some changes are required, both to avoid unnecessary changes to the codebase, but mainly to make sure these large files are properly cleaned.
There was a problem hiding this comment.
This golden serves no real purpose - you can just compare the size in the test itself.
There was a problem hiding this comment.
removed the golden file and the test now checks the size directly
| objectPrefix = strings.TrimPrefix(objectPrefix, "/") | ||
| for _, match := range rePhysicalAddress.FindAllString(output, -1) { | ||
| output = strings.Replace(output, objectPrefix+match, objectPrefix+"/<OBJECT_KEY>", 1) | ||
| if strings.Contains(output, objectPrefix+match) { |
There was a problem hiding this comment.
These changes can hide future bugs in golden files.
Instead, I suggest to use RunCmdAndVerifySuccess in your tests, avoid using a golden file for these tests, and keep this file untouched.
There was a problem hiding this comment.
I reverted these so lakectl_util.go is untouched now... I used RunCmdAndVerifyContainsText on the size line instead of RunCmdAndVerifySuccess
|
|
||
| t.Run("pre-sign", func(t *testing.T) { | ||
| vars["FILE_PATH"] = "large_file_presign" | ||
| RunCmdAndVerifySuccessWithFile(t, Lakectl()+" fs upload -s "+f.Name()+" lakefs://"+repoName+"/"+mainBranch+"/"+vars["FILE_PATH"]+" --pre-sign", false, "lakectl_fs_upload_large", vars) |
There was a problem hiding this comment.
This upload (and the following one) command uploads the large file to the storage.
While the repo is deleted as part of the ESTI tests cleanup, these files are not cleaned up from the storage itself. When running on a temp MinIO this is fine, but if it runs on S3, it will leave unused large files on the storage. Please make sure these are cleaned.
There was a problem hiding this comment.
each subtest now deletes its large object from S3 on cleanup, through a new Delete on the esti S3 adapter
| reTime = regexp.MustCompile(`\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} [-+]\d{4} \w{1,4}`) | ||
| reCommitID = regexp.MustCompile(`[\d|a-f]{64}`) | ||
| reShortCommitID = regexp.MustCompile(`[\d|a-f]{16}`) | ||
| // multipart uploads report an etag with a part count suffix, e.g. <md5>-1025 |
There was a problem hiding this comment.
Please keep the same code style and avoid these extra comments.
Same for the next vars here.
arielshaqed
left a comment
There was a problem hiding this comment.
Thanks for this contribution, seems great!
| require.NoError(t, f.Close()) | ||
|
|
||
| t.Run("pre-sign", func(t *testing.T) { | ||
| vars["FILE_PATH"] = "large_file_presign" |
There was a problem hiding this comment.
What does vars["FILE_PATH"] do here?
There was a problem hiding this comment.
it was only fed the Path line in the golden file, which is gone now, so I removed it
|
|
||
| t.Run("pre-sign", func(t *testing.T) { | ||
| vars["FILE_PATH"] = "large_file_presign" | ||
| RunCmdAndVerifySuccessWithFile(t, Lakectl()+" fs upload -s "+f.Name()+" lakefs://"+repoName+"/"+mainBranch+"/"+vars["FILE_PATH"]+" --pre-sign", false, "lakectl_fs_upload_large", vars) |
There was a problem hiding this comment.
Can we verify the contents, or the size? (ETag itself is hard, it is not really a function of contents because it also depends on the backend and on the split into parts.)
There was a problem hiding this comment.
addressed in 7e69d65, the test now verifies the size in lakectl's output and through the stat API. i think that's better than a full content check which would entails downloading 5db but I can add one if you'd recommend
Drop the golden file and the sanitizer changes it needed. The test now checks the uploaded size through lakectl output and the stat API, and deletes each large object from the backing store once the subtest ends, since deleting the repository leaves its data in place.
7e69d65 to
92bda4e
Compare
itaigilo
left a comment
There was a problem hiding this comment.
Thanks for the updates, @highlyavailable -
This looks much cleaner now.
Still a small fix is required,
plus a nit - the PR's description is stale now.
| // deleting the repository does not remove its data, so remove the large object from the storage | ||
| physicalAddress, err := url.Parse(statResp.JSON200.PhysicalAddress) | ||
| require.NoError(t, err) | ||
| t.Cleanup(func() { |
There was a problem hiding this comment.
That's a solid improvement.
However, the cleanup should be registered before the upload, in case one of the previous calls are failing.
It should be registered earlier.
Look up the object's physical address in the cleanup itself, so the large object is removed from storage even if the upload or a later check fails.
|
Great stuff @highlyavailable - almost there! I ran the CI on a separate branch, and it seems that the only thing missing is adding That's the only thing blocking the CI, other that that, LGTM. |
The large upload test deletes its objects straight from S3, so the default AWS config needs a region.
itaigilo
left a comment
There was a problem hiding this comment.
LGTM -
Thanks @highlyavailable for your contribution!

Closes #9284
Adds esti coverage for
lakectl fs uploadof a file over 5GiB, with and without--pre-sign, which is the multipart path fixed in #9283.Deleteto the esti S3 adapter for this)