fix dn.volumes Iterate when write issue

This commit is contained in:
cheng.li01 2020-07-08 19:57:19 +08:00
parent 54d6b3c30f
commit dad1161c70

View file

@ -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 {