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
add locking when adjusting topology
Chris Lu9782ace1bdcf
diff --git a/weed-fs/src/pkg/replication/volume_growth.go b/weed-fs/src/pkg/replication/volume_growth.goindex 3942c57431..b73a89339e 100644--- a/weed-fs/src/pkg/replication/volume_growth.go+++ b/weed-fs/src/pkg/replication/volume_growth.go@@ -7,6 +7,7 @@ import ("pkg/operation""pkg/storage""pkg/topology"+ "sync")/*@@ -22,6 +23,8 @@ type VolumeGrowth struct {copy2factor intcopy3factor intcopyAll int++ accessLock sync.Mutex}func NewDefaultVolumeGrowth() *VolumeGrowth {@@ -46,6 +49,9 @@ func (vg *VolumeGrowth) GrowByType(repType storage.ReplicationType, topo *topoloreturn 0, errors.New("Unknown Replication Type!")}func (vg *VolumeGrowth) GrowByCountAndType(count int, repType storage.ReplicationType, topo *topology.Topology) (counter int, err error) {+ vg.accessLock.Lock()+ defer vg.accessLock.Unlock()+counter = 0switch repType {case storage.Copy000: