[#170] tar.gz extraction during upload #176
No reviewers
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-http-gw#176
Loading…
Reference in a new issue
No description provided.
Delete branch "nzinkevich/frostfs-http-gw:zip_explode"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
0b16911a06
tob00a4b4847
b00a4b4847
to240bf7bc72
[#170] GZIP tar downloading and uploadingto [#170] tar.gz downloading and uploading240bf7bc72
to973373685e
[#170] tar.gz downloading and uploadingto [#170] Archive extraction during upload[#170] Archive extraction during uploadto [#170] tar.gz extraction during upload[#170] tar.gz extraction during uploadto WIP: [#170] tar.gz extraction during upload973373685e
to69ad977577
WIP: [#170] tar.gz extraction during uploadto [#170] tar.gz extraction during upload69ad977577
to82271223ae
@ -24,1 +28,3 @@
drainBufSize = 4096
jsonHeader = "application/json; charset=UTF-8"
drainBufSize = 4096
explodeArchiveHeader = "Explode-Archive"
Header should be
X-Expode-Archive
@ -73,3 +75,3 @@
log.Debug(
logs.CloseTemporaryMultipartFormFile,
zap.Stringer("address", addr),
zap.Stringer("container", bktInfo.CID),
Actually, as I remembered this log was aimed to print address of uploaded objects. It's better to keep such behavior. Maybe using some different approach but still
Also, I don't think we should add attribute
Explode-Archive
to result objects@ -88,0 +121,4 @@
return
}
c.Response.Header.SetContentType(jsonHeader)
Despite this won't affect behavior, can we set header before setting body?
@ -151,0 +198,4 @@
// explodeGzip read files from tar.gz archive and creates objects for each of them.
// Sets FilePath attribute with name from tar.Header.
func (h *Handler) explodeGzip(c *fasthttp.RequestCtx, log *zap.Logger, bktInfo *data.BucketInfo, file io.Reader) {
gzipReader, err := gzip.NewReader(file)
Why do we require archive be gziped? I supposed we can upload archive created like
tar -cf dir.tar.gz dir
but not it doesn't work:Oh, It seems I was wrong with command. I should use
-z
flagBut should we support not zipped tar?
@ -175,0 +229,4 @@
if err != nil {
return
}
log.Debug(logs.ObjectUploaded, zap.String("object ID", idObj.EncodeToString()))
Let's log also object name
@ -30,0 +32,4 @@
FailedToReadFileFromTar = "failed to read file from tar" // Error in ../../uploader/upload.go
FailedToFilterHeaders = "failed to filter headers" // Error in ../../uploader/upload.go
FailedToUploadObject = "failed to upload object" // Error in ../../uploader/upload.go
ObjectUploaded = "object uploaded" // Debug in ../../uploader/upload.go
It's better not to add comments at the end of lines
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.