aboutsummaryrefslogtreecommitdiff
path: root/weed
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-02-27 00:07:25 -0800
committerChris Lu <chris.lu@gmail.com>2020-02-27 00:07:25 -0800
commit757c7d67adaa58ca710bf39cfa87fd4fc23c756b (patch)
treeb58a8d41a032977b6c4c2bef00ea44322c4a2c60 /weed
parent555413d9fc4837302ef1c5b2b921b406c9de6777 (diff)
downloadseaweedfs-757c7d67adaa58ca710bf39cfa87fd4fc23c756b.tar.xz
seaweedfs-757c7d67adaa58ca710bf39cfa87fd4fc23c756b.zip
avoid nil DataBackend
Diffstat (limited to 'weed')
-rw-r--r--weed/storage/volume_vacuum.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/weed/storage/volume_vacuum.go b/weed/storage/volume_vacuum.go
index db9765cff..34e3db66b 100644
--- a/weed/storage/volume_vacuum.go
+++ b/weed/storage/volume_vacuum.go
@@ -91,8 +91,10 @@ func (v *Volume) CommitCompact() error {
glog.V(3).Infof("Got volume %d committing lock...", v.Id)
v.nm.Close()
- if err := v.DataBackend.Close(); err != nil {
- glog.V(0).Infof("fail to close volume %d", v.Id)
+ if v.DataBackend != nil {
+ if err := v.DataBackend.Close(); err != nil {
+ glog.V(0).Infof("fail to close volume %d", v.Id)
+ }
}
v.DataBackend = nil
stats.VolumeServerVolumeCounter.WithLabelValues(v.Collection, "volume").Dec()