Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multipart upload fully obeys keep-etag config #5338

Closed
wants to merge 1 commit into from

Conversation

polyrabbit
Copy link
Contributor

In current code - when keep-etag is disabled (by default), they are saved but never used.

juicefs/pkg/gateway/gateway.go

Lines 1082 to 1085 in b63efb6

// Calculate s3 compatible md5sum for complete multipart.
s3MD5 := minio.ComputeCompleteMultipartMD5(parts)
if n.gConf.KeepEtag {
eno = n.fs.SetXattr(mctx, tmp, s3Etag, []byte(s3MD5), 0)

@@ -1027,7 +1030,7 @@ func (n *jfsObjects) PutObjectPart(ctx context.Context, bucket, object, uploadID
var etag string
if err = n.putObject(ctx, bucket, p, r, opts, func(tmpName string) {
etag = r.MD5CurrentHexString()
if n.fs.SetXattr(mctx, tmpName, s3Etag, []byte(etag), 0) != 0 {
if n.gConf.KeepEtag && n.fs.SetXattr(mctx, tmpName, s3Etag, []byte(etag), 0) != 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep this, and verify that in CompleteMultipartUpload

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I will keep the code as is.

@polyrabbit polyrabbit closed this Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants