mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix bug deleting volume or unmount volume if a volume server has multiple directories
This commit is contained in:
parent
0a137e675d
commit
8e9ad7db5a
|
@ -434,10 +434,13 @@ func (s *Store) UnmountVolume(i needle.VolumeId) error {
|
|||
}
|
||||
|
||||
for _, location := range s.Locations {
|
||||
if err := location.UnloadVolume(i); err == nil || err == ErrVolumeNotFound {
|
||||
err := location.UnloadVolume(i)
|
||||
if err == nil {
|
||||
glog.V(0).Infof("UnmountVolume %d", i)
|
||||
s.DeletedVolumesChan <- message
|
||||
return nil
|
||||
} else if err == ErrVolumeNotFound {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -458,10 +461,13 @@ func (s *Store) DeleteVolume(i needle.VolumeId) error {
|
|||
DiskType: string(v.location.DiskType),
|
||||
}
|
||||
for _, location := range s.Locations {
|
||||
if err := location.DeleteVolume(i); err == nil || err == ErrVolumeNotFound {
|
||||
err := location.DeleteVolume(i)
|
||||
if err == nil {
|
||||
glog.V(0).Infof("DeleteVolume %d", i)
|
||||
s.DeletedVolumesChan <- message
|
||||
return nil
|
||||
} else if err == ErrVolumeNotFound {
|
||||
continue
|
||||
} else {
|
||||
glog.Errorf("DeleteVolume %d: %v", i, err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue