avoid nil DataBackend
This commit is contained in:
@@ -91,9 +91,11 @@ func (v *Volume) CommitCompact() error {
|
|||||||
|
|
||||||
glog.V(3).Infof("Got volume %d committing lock...", v.Id)
|
glog.V(3).Infof("Got volume %d committing lock...", v.Id)
|
||||||
v.nm.Close()
|
v.nm.Close()
|
||||||
|
if v.DataBackend != nil {
|
||||||
if err := v.DataBackend.Close(); err != nil {
|
if err := v.DataBackend.Close(); err != nil {
|
||||||
glog.V(0).Infof("fail to close volume %d", v.Id)
|
glog.V(0).Infof("fail to close volume %d", v.Id)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
v.DataBackend = nil
|
v.DataBackend = nil
|
||||||
stats.VolumeServerVolumeCounter.WithLabelValues(v.Collection, "volume").Dec()
|
stats.VolumeServerVolumeCounter.WithLabelValues(v.Collection, "volume").Dec()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user