Browse Source

Revert "Merge pull request #1683 from qieqieplus/master"

This reverts commit 8cb67952db, reversing
changes made to 200e56215a.
pull/1690/head
Chris Lu 4 years ago
parent
commit
986cbdf7d9
  1. 12
      weed/storage/disk_location.go

12
weed/storage/disk_location.go

@ -99,14 +99,12 @@ func (l *DiskLocation) loadExistingVolume(fileInfo os.FileInfo, needleMapKind Ne
}
// avoid loading one volume more than once
l.volumesLock.Lock()
if _, found := l.volumes[vid]; found {
l.volumesLock.Unlock()
l.volumesLock.RLock()
_, found := l.volumes[vid]
l.volumesLock.RUnlock()
if found {
glog.V(1).Infof("loaded volume, %v", vid)
return true
} else {
l.volumes[vid] = nil
l.volumesLock.Unlock()
}
// load the volume
@ -115,7 +113,7 @@ func (l *DiskLocation) loadExistingVolume(fileInfo os.FileInfo, needleMapKind Ne
glog.V(0).Infof("new volume %s error %s", volumeName, e)
return false
}
l.SetVolume(vid, v)
size, _, _ := v.FileStat()

Loading…
Cancel
Save