Skip to content

feat: implement multipart upload functionality in jfs#7163

Open
zhijian-pro wants to merge 3 commits into
mainfrom
object-part
Open

feat: implement multipart upload functionality in jfs#7163
zhijian-pro wants to merge 3 commits into
mainfrom
object-part

Conversation

@zhijian-pro

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds multipart upload support to the jfs:// object storage implementation (used by JuiceFS CLI tooling) so large-object writes can be performed as multi-part uploads and merged server-side via CopyFileRange.

Changes:

  • Advertises multipart capabilities via Limits() and returns an UploadID from CreateMultipartUpload.
  • Implements part staging under a per-upload directory and supports streaming part uploads via UploadPartStream.
  • Implements multipart completion by concatenating part files into a temporary “complete” object and renaming it into place; adds AbortUpload cleanup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/object.go
Comment thread cmd/object.go
Comment thread cmd/object.go
Comment thread cmd/object.go
Comment on lines +432 to +436
func (j *juiceFS) UploadPartStream(key string, uploadID string, num int, in io.Reader) (*object.Part, error) {
err := j.Put(context.Background(), path.Join(j.partDir(key, uploadID), strconv.Itoa(num)), in)
return &object.Part{
Num: num,
}, err

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

其他地方实际不使用jfs

Comment thread cmd/object.go
Comment thread cmd/object.go
Comment thread cmd/object.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

Comment thread cmd/object.go
Comment on lines +406 to +414
func (j *juiceFS) Limits() object.Limits {
return object.Limits{
IsSupportMultipartUpload: true,
IsSupportUploadPartCopy: false,
MinPartSize: 4 << 30,
MaxPartSize: 4 << 30,
MaxPartCount: 10000000,
}
}
Comment thread cmd/object.go
Comment on lines +424 to +430
func (j *juiceFS) partDir(key, uploadID string) string {
name := path.Base(key)
if len(name) > 200 {
name = name[:200]
}
return fmt.Sprintf("%s/.jfs-part-%s-%s/", path.Dir(key), name, uploadID)
}
Comment thread cmd/object.go
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@zhijian-pro zhijian-pro requested a review from jiefenghuang June 12, 2026 03:25
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