SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
feat:add a uuid after uploadid (#3963)
famosssdf0662038c99
diff --git a/weed/s3api/filer_multipart.go b/weed/s3api/filer_multipart.goindex 71b93a2021..0167b5906a 100644--- a/weed/s3api/filer_multipart.go+++ b/weed/s3api/filer_multipart.go@@ -4,6 +4,7 @@ import ("encoding/hex""encoding/xml""fmt"+ "github.com/google/uuid""github.com/seaweedfs/seaweedfs/weed/s3api/s3err""golang.org/x/exp/slices""math"@@ -32,6 +33,8 @@ func (s3a *S3ApiServer) createMultipartUpload(input *s3.CreateMultipartUploadInpuploadIdString := s3a.generateUploadID(*input.Key)+ uploadIdString = uploadIdString + "_" +strings.ReplaceAll(uuid.New().String(),"-","")+if err := s3a.mkdir(s3a.genUploadsFolder(*input.Bucket), uploadIdString, func(entry *filer_pb.Entry) {if entry.Extended == nil {entry.Extended = make(map[string][]byte)diff --git a/weed/s3api/s3api_object_multipart_handlers.go b/weed/s3api/s3api_object_multipart_handlers.goindex 96000310c1..d30e65ad9c 100644--- a/weed/s3api/s3api_object_multipart_handlers.go+++ b/weed/s3api/s3api_object_multipart_handlers.go@@ -284,8 +284,9 @@ func (s3a *S3ApiServer) generateUploadID(object string) string {// Check object name and uploadID when processing multipart uploadingfunc (s3a *S3ApiServer) checkUploadId(object string, id string) error {- hash := s3a.generateUploadID(object)- if hash != id {+ hash := s3a.generateUploadID(strings.Split(object, "_")[0])++ if !strings.HasPrefix(id, hash) {glog.Errorf("object %s and uploadID %s are not matched", object, id)return fmt.Errorf("object %s and uploadID %s are not matched", object, id)}