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
avoid race conditions access to SuperBlock.Version (#3539)
Konstantin Lebedevade94b0d0a71
diff --git a/weed/storage/volume.go b/weed/storage/volume.goindex 91d2d0d1f7..e48a2f49a4 100644--- a/weed/storage/volume.go+++ b/weed/storage/volume.go@@ -36,6 +36,7 @@ type Volume struct {super_block.SuperBlockdataFileAccessLock sync.RWMutex+ superBlockAccessLock sync.MutexasyncRequestsChan chan *needle.AsyncRequestlastModifiedTsSeconds uint64 // unix time in secondslastAppendAtNs uint64 // unix time in nanoseconds@@ -97,6 +98,8 @@ func (v *Volume) FileName(ext string) (fileName string) {}func (v *Volume) Version() needle.Version {+ v.superBlockAccessLock.Lock()+ defer v.superBlockAccessLock.Unlock()if v.volumeInfo.Version != 0 {v.SuperBlock.Version = needle.Version(v.volumeInfo.Version)}