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
rename
Chris Lu96ce85f5ae62
diff --git a/weed/server/volume_server.go b/weed/server/volume_server.goindex 3bf740dc03..a0f32700b5 100644--- a/weed/server/volume_server.go+++ b/weed/server/volume_server.go@@ -17,9 +17,9 @@ import ()type VolumeServer struct {- inFlightDataSize int64- concurrentUploadLimit int64- inFlightDataLimitCond *sync.Cond+ inFlightUploadDataSize int64+ concurrentUploadLimit int64+ inFlightUploadDataLimitCond *sync.CondSeedMasterNodes []stringcurrentMaster string@@ -68,18 +68,18 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string,vs := &VolumeServer{pulseSeconds: pulseSeconds,- dataCenter: dataCenter,- rack: rack,- needleMapKind: needleMapKind,- FixJpgOrientation: fixJpgOrientation,- ReadMode: readMode,- grpcDialOption: security.LoadClientTLS(util.GetViper(), "grpc.volume"),- compactionBytePerSecond: int64(compactionMBPerSecond) * 1024 * 1024,- fileSizeLimitBytes: int64(fileSizeLimitMB) * 1024 * 1024,- isHeartbeating: true,- stopChan: make(chan bool),- inFlightDataLimitCond: sync.NewCond(new(sync.Mutex)),- concurrentUploadLimit: concurrentUploadLimit,+ dataCenter: dataCenter,+ rack: rack,+ needleMapKind: needleMapKind,+ FixJpgOrientation: fixJpgOrientation,+ ReadMode: readMode,+ grpcDialOption: security.LoadClientTLS(util.GetViper(), "grpc.volume"),+ compactionBytePerSecond: int64(compactionMBPerSecond) * 1024 * 1024,+ fileSizeLimitBytes: int64(fileSizeLimitMB) * 1024 * 1024,+ isHeartbeating: true,+ stopChan: make(chan bool),+ inFlightUploadDataLimitCond: sync.NewCond(new(sync.Mutex)),+ concurrentUploadLimit: concurrentUploadLimit,}vs.SeedMasterNodes = masterNodesdiff --git a/weed/server/volume_server_handlers.go b/weed/server/volume_server_handlers.goindex 8ac3c0d904..917c7cd257 100644--- a/weed/server/volume_server_handlers.go+++ b/weed/server/volume_server_handlers.go@@ -45,16 +45,16 @@ func (vs *VolumeServer) privateStoreHandler(w http.ResponseWriter, r *http.Reque// wait until in flight data is less than the limitcontentLength := getContentLength(r)- vs.inFlightDataLimitCond.L.Lock()- for vs.concurrentUploadLimit != 0 && atomic.LoadInt64(&vs.inFlightDataSize) > vs.concurrentUploadLimit {- glog.V(4).Infof("wait because inflight data %d > %d", vs.inFlightDataSize, vs.concurrentUploadLimit)- vs.inFlightDataLimitCond.Wait()+ vs.inFlightUploadDataLimitCond.L.Lock()+ for vs.concurrentUploadLimit != 0 && atomic.LoadInt64(&vs.inFlightUploadDataSize) > vs.concurrentUploadLimit {+ glog.V(4).Infof("wait because inflight data %d > %d", vs.inFlightUploadDataSize, vs.concurrentUploadLimit)+ vs.inFlightUploadDataLimitCond.Wait()}- atomic.AddInt64(&vs.inFlightDataSize, contentLength)- vs.inFlightDataLimitCond.L.Unlock()+ atomic.AddInt64(&vs.inFlightUploadDataSize, contentLength)+ vs.inFlightUploadDataLimitCond.L.Unlock()defer func() {- atomic.AddInt64(&vs.inFlightDataSize, -contentLength)- vs.inFlightDataLimitCond.Signal()+ atomic.AddInt64(&vs.inFlightUploadDataSize, -contentLength)+ vs.inFlightUploadDataLimitCond.Signal()}()// processs uploads