aboutsummaryrefslogtreecommitdiff
path: root/weed/topology/node.go
diff options
context:
space:
mode:
authorwusong <75450248+wusongANKANG@users.noreply.github.com>2023-05-22 13:18:50 +0800
committerGitHub <noreply@github.com>2023-05-21 22:18:50 -0700
commit8fffe3e82266530f29385085cfa1e20275a4c8d8 (patch)
tree04d13810492aa4fa7a35435f2493754ef43042c7 /weed/topology/node.go
parent8f3bd202e54b1e83bbd76ee63d103202308f3e39 (diff)
downloadseaweedfs-8fffe3e82266530f29385085cfa1e20275a4c8d8.tar.xz
seaweedfs-8fffe3e82266530f29385085cfa1e20275a4c8d8.zip
fix no more writables volumes while disk free space is sufficient (#4491)
Co-authored-by: wang wusong <wangwusong@virtaitech.com>
Diffstat (limited to 'weed/topology/node.go')
-rw-r--r--weed/topology/node.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/weed/topology/node.go b/weed/topology/node.go
index ae58891e4..89a6305e8 100644
--- a/weed/topology/node.go
+++ b/weed/topology/node.go
@@ -243,6 +243,7 @@ func (n *NodeImpl) CollectDeadNodeAndFullVolumes(freshThreshHold int64, volumeSi
if n.IsRack() {
for _, c := range n.Children() {
dn := c.(*DataNode) //can not cast n to DataNode
+ dn.RLock()
for _, v := range dn.GetVolumes() {
if v.Size >= volumeSizeLimit {
//fmt.Println("volume",v.Id,"size",v.Size,">",volumeSizeLimit)
@@ -259,6 +260,7 @@ func (n *NodeImpl) CollectDeadNodeAndFullVolumes(freshThreshHold int64, volumeSi
}
}
}
+ dn.RUnlock()
}
} else {
for _, c := range n.Children() {