Skip to content

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.

smaller critical section

chenqieqie45f902a9b7ab
diff --git a/weed/storage/disk_location.go b/weed/storage/disk_location.go
index 73d9d8111d..359d0cec2f 100644
--- a/weed/storage/disk_location.go
+++ b/weed/storage/disk_location.go
@@ -104,19 +104,19 @@ func (l *DiskLocation) loadExistingVolume(fileInfo os.FileInfo, needleMapKind Ne
l.volumesLock.Unlock()
glog.V(1).Infof("loaded volume, %v", vid)
return true
+ } else {
+ l.volumes[vid] = nil
+ l.volumesLock.Unlock()
}
// load the volume
v, e := NewVolume(l.Directory, l.IdxDirectory, collection, vid, needleMapKind, nil, nil, 0, 0)
if e != nil {
- l.volumesLock.Unlock()
glog.V(0).Infof("new volume %s error %s", volumeName, e)
return false
}
-
- l.volumes[vid] = v
- v.location = l
- l.volumesLock.Unlock()
+
+ l.SetVolume(vid, v)
size, _, _ := v.FileStat()
glog.V(0).Infof("data file %s, replicaPlacement=%s v=%d size=%d ttl=%s",