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.

avoid dead lock

chrislu3cb914f7e12a
diff --git a/weed/topology/data_center.go b/weed/topology/data_center.go
index 5ffbe4bb85..26d2de7d33 100644
--- a/weed/topology/data_center.go
+++ b/weed/topology/data_center.go
@@ -29,7 +29,7 @@ func (dc *DataCenter) GetOrCreateRack(rackName string) *Rack {
}
}
rack := NewRack(rackName)
- dc.LinkChildNode(rack)
+ dc.doLinkChildNode(rack)
return rack
}
diff --git a/weed/topology/rack.go b/weed/topology/rack.go
index d388e9c617..c96bf421e3 100644
--- a/weed/topology/rack.go
+++ b/weed/topology/rack.go
@@ -47,7 +47,7 @@ func (r *Rack) GetOrCreateDataNode(ip string, port int, grpcPort int, publicUrl
dn.GrpcPort = grpcPort
dn.PublicUrl = publicUrl
dn.LastSeen = time.Now().Unix()
- r.LinkChildNode(dn)
+ r.doLinkChildNode(dn)
for diskType, maxVolumeCount := range maxVolumeCounts {
disk := NewDisk(diskType)
disk.diskUsages.getOrCreateDisk(types.ToDiskType(diskType)).maxVolumeCount = int64(maxVolumeCount)
diff --git a/weed/topology/topology.go b/weed/topology/topology.go
index 406ee30f6b..6c6fc73a45 100644
--- a/weed/topology/topology.go
+++ b/weed/topology/topology.go
@@ -267,7 +267,7 @@ func (t *Topology) GetOrCreateDataCenter(dcName string) *DataCenter {
}
}
dc := NewDataCenter(dcName)
- t.LinkChildNode(dc)
+ t.doLinkChildNode(dc)
return dc
}