From 0559aa96738d727e055190301bbb0624c74ced7f Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 7 Sep 2016 18:13:49 -0700 Subject: [PATCH] use Lock instead of RLock fix https://github.com/chrislusf/seaweedfs/issues/364 --- weed/topology/data_node.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/weed/topology/data_node.go b/weed/topology/data_node.go index da6ed2895..b7f039559 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) }