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
[master] refactor HasGrowRequest to atomic bool (#5782)
Konstantin Lebedeva53e406c994e
diff --git a/weed/topology/volume_layout.go b/weed/topology/volume_layout.goindex f2c341b7c7..5711a6a9b0 100644--- a/weed/topology/volume_layout.go+++ b/weed/topology/volume_layout.go@@ -106,7 +106,7 @@ func (v *volumesBinaryState) copyState(list *VolumeLocationList) copyState {// mapping from volume to its locations, inverted from server to volumetype VolumeLayout struct {- growRequestCount int32+ growRequest atomic.Boolrp *super_block.ReplicaPlacementttl *needle.TTLdiskType types.DiskType@@ -345,13 +345,13 @@ func (vl *VolumeLayout) PickForWrite(count uint64, option *VolumeGrowOption) (vi}func (vl *VolumeLayout) HasGrowRequest() bool {- return atomic.LoadInt32(&vl.growRequestCount) > 0+ return vl.growRequest.Load()}func (vl *VolumeLayout) AddGrowRequest() {- atomic.AddInt32(&vl.growRequestCount, 1)+ vl.growRequest.Store(true)}func (vl *VolumeLayout) DoneGrowRequest() {- atomic.AddInt32(&vl.growRequestCount, -1)+ vl.growRequest.Store(false)}func (vl *VolumeLayout) ShouldGrowVolumes(option *VolumeGrowOption) bool {