Delete volumes online without restarting volume server

This commit is contained in:
brstgt
2017-01-20 13:02:37 +01:00
parent 492f93416d
commit e074a54a20
5 changed files with 65 additions and 34 deletions

View File

@@ -152,7 +152,15 @@ func (l *DiskLocation) LoadVolume(vid VolumeId, needleMapKind NeedleMapType) boo
return false
}
func (l *DiskLocation) UnloadVolume(vid VolumeId) (e error) {
func (l *DiskLocation) DeleteVolume(vid VolumeId) (error) {
_, ok := l.volumes[vid]
if !ok {
return fmt.Errorf("Volume not found, VolumeId: %d", vid)
}
return l.deleteVolumeById(vid)
}
func (l *DiskLocation) UnloadVolume(vid VolumeId) (error) {
_, ok := l.volumes[vid]
if !ok {
return fmt.Errorf("Volume not loaded, VolumeId: %d", vid)