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
ensure single threaded access
chrislu07c2d75ac7cc
diff --git a/weed/operation/assign_file_id.go b/weed/operation/assign_file_id.goindex a4753d234e..f6d0e01100 100644--- a/weed/operation/assign_file_id.go+++ b/weed/operation/assign_file_id.go@@ -8,6 +8,7 @@ import ("github.com/seaweedfs/seaweedfs/weed/security""github.com/seaweedfs/seaweedfs/weed/storage/needle""google.golang.org/grpc"+ "sync")type VolumeAssignRequest struct {@@ -66,9 +67,13 @@ func (ap *AssignProxy) Assign(primaryRequest *VolumeAssignRequest, alternativeRetype singleThreadAssignProxy struct {assignClient master_pb.Seaweed_StreamAssignClient+ sync.Mutex}func (ap *singleThreadAssignProxy) doAssign(grpcConnection *grpc.ClientConn, primaryRequest *VolumeAssignRequest, alternativeRequests ...*VolumeAssignRequest) (ret *AssignResult, err error) {+ ap.Lock()+ defer ap.Unlock()+if ap.assignClient == nil {client := master_pb.NewSeaweedClient(grpcConnection)ap.assignClient, err = client.StreamAssign(context.Background())