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.

use Lock instead of RLock

Chris Lu0559aa96738d
diff --git a/weed/topology/data_node.go b/weed/topology/data_node.go
index da6ed2895e..b7f0395596 100644
--- a/weed/topology/data_node.go
+++ b/weed/topology/data_node.go
@@ -53,7 +53,7 @@ func (dn *DataNode) UpdateVolumes(actualVolumes []storage.VolumeInfo) (deletedVo
for _, v := range actualVolumes {
actualVolumeMap[v.Id] = v
}
- dn.RLock()
+ dn.Lock()
for vid, v := range dn.volumes {
if _, ok := actualVolumeMap[vid]; !ok {
glog.V(0).Infoln("Deleting volume id:", vid)
@@ -62,8 +62,8 @@ func (dn *DataNode) UpdateVolumes(actualVolumes []storage.VolumeInfo) (deletedVo
dn.UpAdjustVolumeCountDelta(-1)
dn.UpAdjustActiveVolumeCountDelta(-1)
}
- } //TODO: adjust max volume id, if need to reclaim volume ids
- dn.RUnlock()
+ }
+ dn.Unlock()
for _, v := range actualVolumes {
dn.AddOrUpdateVolume(v)
}