mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 10:37:24 +08:00
Merge branch 'master' into support_ssd_volume
This commit is contained in:
@@ -101,12 +101,14 @@ func (l *DiskLocation) loadExistingVolume(fileInfo os.FileInfo, needleMapKind Ne
|
||||
}
|
||||
|
||||
// avoid loading one volume more than once
|
||||
l.volumesLock.RLock()
|
||||
_, found := l.volumes[vid]
|
||||
l.volumesLock.RUnlock()
|
||||
if found {
|
||||
l.volumesLock.Lock()
|
||||
if _, found := l.volumes[vid]; found {
|
||||
l.volumesLock.Unlock()
|
||||
glog.V(1).Infof("loaded volume, %v", vid)
|
||||
return true
|
||||
} else {
|
||||
l.volumes[vid] = nil
|
||||
l.volumesLock.Unlock()
|
||||
}
|
||||
|
||||
// load the volume
|
||||
@@ -115,7 +117,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()
|
||||
|
Reference in New Issue
Block a user