From dad1161c7002d074ef87e4b9279881e4e4a6e426 Mon Sep 17 00:00:00 2001 From: "cheng.li01" Date: Wed, 8 Jul 2020 19:57:19 +0800 Subject: [PATCH] fix dn.volumes Iterate when write issue --- weed/topology/data_node.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/weed/topology/data_node.go b/weed/topology/data_node.go index d18dd6af0..efdf5285b 100644 --- a/weed/topology/data_node.go +++ b/weed/topology/data_node.go @@ -199,6 +199,8 @@ func (dn *DataNode) ToDataNodeInfo() *master_pb.DataNodeInfo { // GetVolumeIds returns the human readable volume ids limited to count of max 100. func (dn *DataNode) GetVolumeIds() string { + dn.RLock() + defer dn.RUnlock() ids := make([]int, 0, len(dn.volumes)) for k := range dn.volumes {